You are here

public function LocaleListener::onKernelRequest in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/EventListener/LocaleListener.php \Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest()

File

vendor/symfony/http-kernel/EventListener/LocaleListener.php, line 71

Class

LocaleListener
Initializes the locale based on the current request.

Namespace

Symfony\Component\HttpKernel\EventListener

Code

public function onKernelRequest(GetResponseEvent $event) {
  $request = $event
    ->getRequest();
  $request
    ->setDefaultLocale($this->defaultLocale);
  $this
    ->setLocale($request);
  $this
    ->setRouterContext($request);
}