src/Controller/Website/LoggerController.php line 43

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Sulu.
  4.  *
  5.  * (c) Sulu GmbH
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  * App\Controller\Website\LoggerController
  10.  */
  11. namespace App\Controller\Website;
  12. use Sulu\Bundle\WebsiteBundle\Controller\WebsiteController;
  13. use Sulu\Component\Content\Compat\StructureInterface;
  14. use Symfony\Component\HttpFoundation\Response;
  15. use Symfony\Component\HttpKernel\EventListener\AbstractSessionListener;
  16. use Symfony\Component\HttpFoundation\RedirectResponse;
  17. use Symfony\Component\HttpFoundation\RequestStack;
  18. /**
  19.  * Default Controller for rendering templates, uses the themes from the ClientWebsiteBundle.
  20.  */
  21. class LoggerController extends WebsiteController
  22. {
  23.     private $requestStack;
  24.     public function __construct(RequestStack $requestStack)
  25.     {
  26.         $this->requestStack $requestStack;
  27.     }
  28.     /**
  29.      * Loads the content from the request (filled by the route provider) and creates a response with this content and
  30.      * the appropriate cache headers.
  31.      *
  32.      * @param bool $preview
  33.      * @param bool $partial
  34.      *
  35.      * @return Response
  36.      */
  37.     public function indexAction(StructureInterface $structure$preview false$partial false)
  38.     {
  39.         $request $this->requestStack->getCurrentRequest();
  40.         // Отримання мови із запиту
  41.         $locale $request->getLocale();
  42.         return new RedirectResponse('/'$locale '/mediabank');
  43.     }
  44. }