Exemple #1
0
 /**
  * __invoke
  *
  * @param RequestInterface  $request
  * @param ResponseInterface $response
  * @param callable|null     $next
  *
  * @return ResponseInterface
  */
 public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next = null)
 {
     $locale = $this->siteService->getCurrentSite()->getLocale();
     // @todo Set from $request site getSiteFromRequest($request)
     $this->localeService->setLocale($locale);
     return $next($request, $response);
 }
Exemple #2
0
 /**
  * Set the system locale to Site Requirements
  *
  * @param MvcEvent $event
  *
  * @return null
  */
 public function addLocale(MvcEvent $event)
 {
     $locale = $this->siteService->getCurrentSite()->getLocale();
     $this->localeService->setLocale($locale);
     return null;
 }