Router
class Router implements RouterInterface (View source)
The default web router
Properties
protected LoggerInterface | $logger | ||
protected ConfigurationManager | $configurationManager | ||
protected RouterCachingService | $routerCachingService | ||
protected array | $routesConfiguration | Array containing the configuration for all routes |
|
protected array | $routes | Array of routes to match against |
|
protected bool | $routesCreated | true if route object have been created, otherwise false |
|
protected Route | $lastMatchedRoute | ||
protected Route | $lastResolvedRoute |
Methods
Injects the (system) logger based on PSR-3.
Sets the routes configuration.
Iterates through all configured routes and calls matches() on them.
Returns the route that has been matched with the last route() call.
Returns a list of configured routes
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.
Creates \Neos\Flow\Mvc\Routing\Route objects from the injected routes configuration.
Checks if a routes configuration was set and otherwise loads the configuration from the configuration manager.
Details
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
void
setRoutesConfiguration(array $routesConfiguration = null)
Sets the routes configuration.
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
array
getRoutes()
Returns a list of configured routes
void
addRoute(Route $route)
Manually adds a route to the beginning of the configured routes
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
protected void
createRoutesFromConfiguration()
Creates \Neos\Flow\Mvc\Routing\Route objects from the injected routes configuration.
protected void
initializeRoutesConfiguration()
Checks if a routes configuration was set and otherwise loads the configuration from the configuration manager.