app/Plugin/Synplgblog/Event.php line 42

Open in your IDE?
  1. <?php
  2. namespace Plugin\Synplgblog;
  3. use Eccube\Event\TemplateEvent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Plugin\Synplgblog\Repository\ConfigRepository;
  6. class Event implements EventSubscriberInterface
  7. {
  8.     
  9.     /**
  10.      * @var ConfigRepository
  11.      */
  12.     protected $configRepository;
  13.     /**
  14.      * Event constructor.
  15.      * 
  16.      * @param BlockRepository $blockRepository
  17.      */
  18.     public function __construct(
  19.         ConfigRepository $configRepository)
  20.     {
  21.         $this->configRepository $configRepository;
  22.     }
  23.     /**
  24.      * @return array
  25.      */
  26.     public static function getSubscribedEvents()
  27.     {
  28.         return [
  29.             'default_frame.twig' => 'LoadADefaultFrameTwig',
  30.         ];
  31.     }
  32.     /**
  33.      * @param TemplateEvent $event
  34.      */
  35.     public function LoadADefaultFrameTwig(TemplateEvent $event){
  36.         $parameters $event->getParameters();
  37.         $parameters['Synplgblog']=$this->configRepository->get();
  38.         $event->setParameters($parameters);
  39.     }
  40. }