app/Plugin/tbsCategoryImage/tbsCategoryImageEvent.php line35

Open in your IDE?
  1. <?php
  2. namespace Plugin\tbsCategoryImage;
  3. use Eccube\Event\EventArgs;
  4. use Eccube\Event\TemplateEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class tbsCategoryImageEvent implements EventSubscriberInterface
  7. {
  8.     /**
  9.      * tbsCategoryImageEvent constructor.
  10.      */
  11.     public function __construct()
  12.     {
  13.     }
  14.     /**
  15.      * @return array
  16.      */
  17.     public static function getSubscribedEvents()
  18.     {
  19.         return [
  20.             '@admin/Product/category.twig' => 'onRenderAdminProductCategory',
  21.             'Product/list.twig' => 'onRenderProductList',
  22.             // 'Block/category_nav_pc.twig' => 'onRenderBlockCategoryNavPc',
  23.             // 'Block/category_nav_sp.twig' => 'onRenderBlockCategoryNavSp',
  24.         ];
  25.     }
  26.     /**
  27.      * 管理画面カテゴリ登録に画像ボタンを表示する.
  28.      *
  29.      * @param TemplateEvent $event
  30.      */
  31.     public function onRenderAdminProductCategory(TemplateEvent $event)
  32.     {
  33.         $event->addSnippet('@tbsCategoryImage/admin/Product/category.twig');
  34.     }
  35.     /**
  36.      * 商品一覧にカテゴリバナーを表示する.
  37.      *
  38.      * @param TemplateEvent $event
  39.      */
  40.     public function onRenderProductList(TemplateEvent $event)
  41.     {
  42.         $event->addSnippet('@tbsCategoryImage/default/Product/list.twig');
  43.     }
  44.     // /**
  45.     //  * カテゴリナビ(PC)にカテゴリアイコンを表示する.
  46.     //  *
  47.     //  * @param TemplateEvent $event
  48.     //  */
  49.     // public function onRenderBlockCategoryNavPc(TemplateEvent $event)
  50.     // {
  51.     //     $event->addSnippet('@tbsCategoryImage/default/Block/category_nav_pc.twig');
  52.     // }
  53.     //
  54.     // /**
  55.     //  * カテゴリナビ(SP)にカテゴリアイコンを表示する.
  56.     //  *
  57.     //  * @param TemplateEvent $event
  58.     //  */
  59.     // public function onRenderBlockCategoryNavSp(TemplateEvent $event)
  60.     // {
  61.     //     $event->addSnippet('@tbsCategoryImage/default/Block/category_nav_sp.twig');
  62.     // }
  63. }