Final Class Yiisoft\Router\RouteCollection
| Inheritance | Yiisoft\Router\RouteCollection |
|---|---|
| Implements | Yiisoft\Router\RouteCollectionInterface |
Public Methods
Method Details
| public __construct( Yiisoft\Router\RouteCollectorInterface $collector ): mixed | ||
| $collector | Yiisoft\Router\RouteCollectorInterface | |
public function __construct(private readonly RouteCollectorInterface $collector) {}
| 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];
}
| public getRouteTree( boolean $routeAsString = true ): array | ||
| $routeAsString | boolean | |
public function getRouteTree(bool $routeAsString = true): array
{
$this->ensureItemsInjected();
return $this->buildTree($this->items, $routeAsString);
}
Signup or Login in order to comment.