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