class RouterListener implements EventSubscriberInterface
Initializes the context from the request and sets request attributes based on a matching route.
This listener works in 2 modes:
__construct(UrlMatcherInterface|RequestMatcherInterface $matcher, RequestContext $context = null, LoggerInterface $logger = null, RequestStack $requestStack = null) Constructor. | ||
setRequest(Request $request = null) Sets the current Request. | ||
onKernelFinishRequest(FinishRequestEvent $event) | ||
onKernelRequest(GetResponseEvent $event) | ||
static array | getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. |
Constructor.
RequestStack will become required in 3.0.
Sets the current Request.
This method was used to synchronize the Request, but as the HttpKernel is doing that automatically now, you should never call it directly. It is kept public for BC with the 2.3 version.
Returns an array of event names this subscriber wants to listen to.
The array keys are event names and the value can be:
For instance:
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/HttpKernel/EventListener/RouterListener.html