searchLastDefaultController example

// Controller is found.             $baseControllerName = class_basename($this->controller);

            // Prevent access to default controller path             if (
                strtolower($baseControllerName) === strtolower($this->defaultController)
            ) {
                throw new PageNotFoundException(
                    'Cannot access the default controller "' . $this->controller . '" with the controller name URI path.'
                );
            }
        } elseif ($this->searchLastDefaultController()) {
            // The default Controller is found.             $baseControllerName = class_basename($this->controller);
        } else {
            // No Controller is found.             throw new PageNotFoundException('No controller is found for: ' . $uri);
        }

        // The first item may be a method name.         /** @phpstan-var list<string> $params */
        $params = $this->params;

        
Home | Imprint | This part of the site doesn't use cookies.