0 follower

Final Class Yiisoft\Router\RouteCollection

InheritanceYiisoft\Router\RouteCollection
ImplementsYiisoft\Router\RouteCollectionInterface

Psalm Types

Name Value
Items array<array-key, array|string>

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Router\RouteCollectorInterface $collector )
$collector Yiisoft\Router\RouteCollectorInterface

                public function __construct(private readonly RouteCollectorInterface $collector)
{
}

            
getRoute() public method

public Yiisoft\Router\Route getRoute ( string $name )
$name string

                public function getRoute(string $name): Route
{
    $this->ensureItemsInjected();
    if (!array_key_exists($name, $this->routes)) {
        throw new RouteNotFoundException($name);
    }
    return $this->routes[$name];
}

            
getRouteTree() public method

public array getRouteTree ( boolean $routeAsString true )
$routeAsString boolean

                public function getRouteTree(bool $routeAsString = true): array
{
    $this->ensureItemsInjected();
    return $this->buildTree($this->items, $routeAsString);
}

            
getRoutes() public method

public array getRoutes ( )

                public function getRoutes(): array
{
    $this->ensureItemsInjected();
    return $this->routes;
}