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 __construct( Yiisoft\Router\RouteCollectorInterface $collector ): mixed
$collector Yiisoft\Router\RouteCollectorInterface

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

            
getRoute() public method

public getRoute( string $name ): Yiisoft\Router\Route
$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 getRouteTree( boolean $routeAsString true ): array
$routeAsString boolean

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

            
getRoutes() public method

public getRoutes( ): array

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