<?php
/*
* This file is part of Sulu.
*
* (c) Sulu GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
* App\Controller\Website\LoggerController
*/
namespace App\Controller\Website;
use Sulu\Bundle\WebsiteBundle\Controller\WebsiteController;
use Sulu\Component\Content\Compat\StructureInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\EventListener\AbstractSessionListener;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\RequestStack;
/**
* Default Controller for rendering templates, uses the themes from the ClientWebsiteBundle.
*/
class LoggerController extends WebsiteController
{
private $requestStack;
public function __construct(RequestStack $requestStack)
{
$this->requestStack = $requestStack;
}
/**
* Loads the content from the request (filled by the route provider) and creates a response with this content and
* the appropriate cache headers.
*
* @param bool $preview
* @param bool $partial
*
* @return Response
*/
public function indexAction(StructureInterface $structure, $preview = false, $partial = false)
{
$request = $this->requestStack->getCurrentRequest();
// Отримання мови із запиту
$locale = $request->getLocale();
return new RedirectResponse('/'. $locale . '/mediabank');
}
}