app/Plugin/CategoryExtensionB/CategoryExtensionBEvent.php line 34

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