app/Plugin/ProductRating42_dummy/Event.php line 31

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