methodName example

$params = $segments;
        }

        // Ensure routes registered via $routes->cli() are not accessible via web.         if ($this->httpVerb !== 'cli') {
            $controller = '\\' . $this->defaultNamespace;

            $controller .= $this->directory ? str_replace('/', '\\', $this->directory) : '';
            $controller .= $controllerName;

            $controller = strtolower($controller);
            $methodName = strtolower($this->methodName());

            foreach ($this->cliRoutes as $handler) {
                if (is_string($handler)) {
                    $handler = strtolower($handler);

                    // Like $routes->cli('hello/(:segment)', 'Home::$1')                     if (strpos($handler, '::$') !== false) {
                        throw new PageNotFoundException(
                            'Cannot access CLI Route: ' . $uri
                        );
                    }

                    
public function display(): array
    {
        $rawRoutes = Services::routes(true);
        $router    = Services::router(null, null, true);

        // Get our parameters         // Closure routes         if (is_callable($router->controllerName())) {
            $method = new ReflectionFunction($router->controllerName());
        } else {
            try {
                $method = new ReflectionMethod($router->controllerName()$router->methodName());
            } catch (ReflectionException $e) {
                // If we're here, the method doesn't exist                 // and is likely calculated in _remap.                 $method = new ReflectionMethod($router->controllerName(), '_remap');
            }
        }

        $rawParams = $method->getParameters();

        $params = [];

        
// $routes is defined in Config/Routes.php         $this->router = Services::router($routes$this->request);

        $path = $this->determinePath();

        $this->benchmark->stop('bootstrap');
        $this->benchmark->start('routing');

        $this->outputBufferingStart();

        $this->controller = $this->router->handle($path);
        $this->method     = $this->router->methodName();

        // If a {locale} segment was matched in the final route,         // then we need to set the correct locale on our Request.         if ($this->router->hasLocale()) {
            $this->request->setLocale($this->router->getLocale());
        }

        $this->benchmark->stop('routing');

        // for backward compatibility         $multipleFiltersEnabled = config(Feature::class)->multipleFilters ?? false;
        
Home | Imprint | This part of the site doesn't use cookies.