app/Plugin/HigashiyamaForContact42/EventSubscriber/Controller/ContactControllerSubscriber.php line 49

Open in your IDE?
  1. <?php
  2. namespace Plugin\HigashiyamaForContact42\EventSubscriber\Controller;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Eccube\Event\TemplateEvent;
  5. use Eccube\Common\EccubeConfig;
  6. class ContactControllerSubscriber implements EventSubscriberInterface
  7. {
  8.     /**
  9.      * @var EccubeConfig
  10.      */
  11.     protected $eccubeConfig;
  12.     /**
  13.      * ProductController constructor.
  14.      *
  15.      * @param EccubeConfig $eccubeConfig
  16.      */
  17.     public function __construct(
  18.         EccubeConfig $eccubeConfig
  19.     ) {
  20.         $this->eccubeConfig $eccubeConfig;
  21.     }
  22.     /**
  23.      * @return array
  24.      */
  25.     public static function getSubscribedEvents()
  26.     {
  27.         return [
  28.             'Contact/index.twig' => ['DefaultContactIndex'1],
  29.             'Contact/confirm.twig' => ['DefaultContactConfirm'1],
  30.         ];
  31.     }
  32.     /**
  33.      * @param TemplateEvent $event
  34.      */
  35.     public function DefaultContactIndex(TemplateEvent $event)
  36.     {
  37.         $event->addSnippet('@HigashiyamaForContact42/default/Contact/index.twig');
  38.     }
  39.     /**
  40.      * @param TemplateEvent $event
  41.      */
  42.     public function DefaultContactConfirm(TemplateEvent $event)
  43.     {
  44.         $event->addSnippet('@HigashiyamaForContact42/default/Contact/confirm.twig');
  45.     }
  46. }