<?php
namespace App\Controller\Website\Lis;
use Sulu\Bundle\WebsiteBundle\Controller\DefaultController;
use Sulu\Component\Content\Compat\StructureInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
class MainController extends DefaultController
{
protected $requestStack;
protected $session;
public function __construct(RequestStack $requestStack, SessionInterface $session)
{
$this->requestStack = $requestStack;
$this->session = $session;
}
protected function getAttributes($attributes, StructureInterface $structure = null, $preview = false)
{
$attributes = parent::getAttributes($attributes, $structure, $preview);
$attributes['lisSesData'] = $this->session->get('lisSesData');
//dd($attributes['request']['webspaceName']);
//dd($this->requestStack->getCurrentRequest()->getClientIp());
return $attributes;
}
public static function getSubscribedServices(): array
{
$subscribedServices = parent::getSubscribedServices();
//$subscribedServices['my_custom_service'] = 'your_service_id_or_class';
return $subscribedServices;
}
}