src/Controller/Website/Lis/MainController.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Website\Lis;
  3. use Sulu\Bundle\WebsiteBundle\Controller\DefaultController;
  4. use Sulu\Component\Content\Compat\StructureInterface;
  5. use Symfony\Component\HttpFoundation\RequestStack;
  6. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  7. class MainController extends DefaultController
  8. {
  9.     protected $requestStack;
  10.     protected $session;
  11.     public function __construct(RequestStack $requestStackSessionInterface $session)
  12.     {
  13.         $this->requestStack $requestStack;
  14.         $this->session $session;
  15.     }
  16.     protected function getAttributes($attributesStructureInterface $structure null$preview false)
  17.     {
  18.         $attributes parent::getAttributes($attributes$structure$preview);
  19.         $attributes['lisSesData'] = $this->session->get('lisSesData');
  20.         //dd($attributes['request']['webspaceName']);
  21.         //dd($this->requestStack->getCurrentRequest()->getClientIp());
  22.         
  23.         return $attributes;
  24.     }
  25.     public static function getSubscribedServices(): array
  26.     {
  27.         $subscribedServices parent::getSubscribedServices();
  28.         //$subscribedServices['my_custom_service'] = 'your_service_id_or_class';
  29.         
  30.         return $subscribedServices;
  31.     }
  32. }