<?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\DependencyInjection\ParameterBag\ParameterBagInterface;
/**
* Default Controller for rendering templates, uses the themes from the ClientWebsiteBundle.
*/
class LoggerController extends WebsiteController
{
private $params;
public function __construct(ParameterBagInterface $params)
{
$this->params = $params;
}
/**
* 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)
{
$appBaseUrl = $_ENV['APP_BASE_URL'] ?? '/';
$appMediabankUrl = $_ENV['APP_MEDIABANK_URL'] ?? '/';
$response = $this->renderStructure(
$structure,
[
'appBaseUrl' => $appBaseUrl,
'appMediabankUrl' => $appMediabankUrl,
],
$preview,
$partial
);
$response->headers->set(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER, 'true');
return $response;
}
}