app/Plugin/TasteManager/Event.php line 28

Open in your IDE?
  1. <?php
  2. namespace Plugin\TasteManager;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Eccube\Event\TemplateEvent;
  5. class Event implements EventSubscriberInterface
  6. {
  7.     
  8.     /**
  9.      * {@inheritdoc}
  10.      *
  11.      * @return array
  12.      */
  13.     public static function getSubscribedEvents()
  14.     {
  15.         return [
  16.             'Product/detail.twig' => ['onTemplateProductDetail'10],
  17.         ];
  18.     }
  19.     /**
  20.      * Append JS to display maker
  21.      *
  22.      * @param TemplateEvent $templateEvent
  23.      */
  24.     public function onTemplateProductDetail(TemplateEvent $templateEvent)
  25.     {
  26.         $templateEvent->addSnippet('@TasteManager/default/taste.twig');
  27.     }
  28. }