Router
class Router implements HasRoutesInterface (View source)
Provide routing for site requests (i.e. all non-api requests).
Traits
Methods
Get the current route.
Merge the methods attribute combining values.
Merge the condition attribute.
Merge the middleware attribute combining values.
Merge the namespace attribute taking the latest value.
Merge the handler attribute taking the latest value.
Merge the handler attribute taking the latest value.
Merge the name attribute combining values with a dot.
Merge attributes into route.
Make a route.
Assign and return the first satisfied route (if any) as the current one for the given request.
Get the url for a named route.
Details
in HasRoutesTrait at line 32
RouteInterface[]
getRoutes()
Get routes.
in HasRoutesTrait at line 42
void
addRoute(RouteInterface $route)
Add a route.
in HasRoutesTrait at line 67
void
removeRoute(RouteInterface $route)
Remove a route.
at line 63
__construct(ConditionFactory $condition_factory, HandlerFactory $handler_factory)
Constructor.
at line 73
RouteInterface
getCurrentRoute()
Get the current route.
at line 83
void
setCurrentRoute(RouteInterface $current_route)
Set the current route.
at line 94
string[]
mergeMethodsAttribute(string[] $old, string[] $new)
Merge the methods attribute combining values.
at line 105
ConditionInterface|string
mergeConditionAttribute(string|array|Closure|ConditionInterface|null $old, string|array|Closure|ConditionInterface|null $new)
Merge the condition attribute.
at line 122
string[]
mergeMiddlewareAttribute(string[] $old, string[] $new)
Merge the middleware attribute combining values.
at line 133
string
mergeNamespaceAttribute(string $old, string $new)
Merge the namespace attribute taking the latest value.
at line 144
string|Closure
mergeHandlerAttribute(string|Closure $old, string|Closure $new)
Merge the handler attribute taking the latest value.
at line 155
string|Closure
mergeQueryAttribute(callable|null $old, callable|null $new)
Merge the handler attribute taking the latest value.
at line 176
string
mergeNameAttribute(string $old, string $new)
Merge the name attribute combining values with a dot.
at line 195
array
mergeAttributes(array $old, array $new)
Merge attributes into route.
at line 327
RouteInterface
route(array $attributes)
Make a route.
at line 353
RouteInterface|null
execute(RequestInterface $request)
Assign and return the first satisfied route (if any) as the current one for the given request.
at line 373
string
getRouteUrl(string $name, array $arguments = [])
Get the url for a named route.