class LocaleListener implements EventSubscriberInterface
Initializes the locale based on the current request.
This listener works in 2 modes:
__construct($defaultLocale = 'en', RequestContextAwareInterface $router = null, RequestStack $requestStack = null) RequestStack will become required in 3.0. | ||
setRequest(Request $request = null) Sets the current Request. | ||
onKernelRequest(GetResponseEvent $event) | ||
onKernelFinishRequest(FinishRequestEvent $event) | ||
static array | getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. |
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/LocaleListener.html