Router
class Router implements RouterInterface (View source)
The default web router
Properties
protected RoutesProviderInterface | $routesProvider | ||
protected LoggerInterface | $logger | ||
protected RouterCachingService | $routerCachingService | ||
protected Route|null | $lastMatchedRoute | ||
protected Route|null | $lastResolvedRoute |
Methods
Injects the (system) logger based on PSR-3.
Iterates through all configured routes and calls matches() on them.
Returns the route that has been matched with the last route() call.
Builds the corresponding uri (excluding protocol and host) by iterating through all configured routes and calling their respective resolves() method. If no matching route is found, an empty string is returned.
Returns the route that has been resolved with the last resolve() call.
Details
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
array
route(RouteContext $routeContext)
Iterates through all configured routes and calls matches() on them.
Returns the matchResults of the matching route or NULL if no matching route could be found.
Route
getLastMatchedRoute()
Returns the route that has been matched with the last route() call.
Returns NULL if no route matched or route() has not been called yet
UriInterface
resolve(ResolveContext $resolveContext)
Builds the corresponding uri (excluding protocol and host) by iterating through all configured routes and calling their respective resolves() method. If no matching route is found, an empty string is returned.
Note: calls of this message are cached by RouterCachingAspect
Route
getLastResolvedRoute()
Returns the route that has been resolved with the last resolve() call.
Returns NULL if no route was found or resolve() has not been called yet