app/Plugin/CategoryRecommend4/CategoryRecommendEvent.php line 56

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Plugin\CategoryRecommend4;
  13. use Eccube\Event\TemplateEvent;
  14. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  15. class CategoryRecommendEvent implements EventSubscriberInterface
  16. {
  17.     /**
  18.      * CategoryRecommendEvent constructor.
  19.      */
  20.     public function __construct()
  21.     {
  22.     }
  23.     /**
  24.      * @return array
  25.      */
  26.     public static function getSubscribedEvents()
  27.     {
  28.         return [
  29.             '@admin/Product/category.twig' => 'onRenderAdminProductCategory',
  30.             'Product/list.twig' => 'onRenderProductList',
  31.             // 'Block/category_nav_pc.twig' => 'onRenderBlockCategoryNavPc',
  32.             // 'Block/category_nav_sp.twig' => 'onRenderBlockCategoryNavSp',
  33.         ];
  34.     }
  35.     /**
  36.      * 管理画面カテゴリ登録に画像ボタンを表示する.
  37.      *
  38.      * @param TemplateEvent $event
  39.      */
  40.     public function onRenderAdminProductCategory(TemplateEvent $event)
  41.     {
  42.         $event->addSnippet('@CategoryRecommend4/admin/Product/category.twig');
  43.     }
  44.     /**
  45.      * 商品一覧にカテゴリバナーを表示する.
  46.      *
  47.      * @param TemplateEvent $event
  48.      */
  49.     public function onRenderProductList(TemplateEvent $event)
  50.     {
  51.         $event->addSnippet('@CategoryRecommend4/default/Product/list.twig');
  52.     }
  53.     // /**
  54.     //  * カテゴリナビ(PC)にカテゴリアイコンを表示する.
  55.     //  *
  56.     //  * @param TemplateEvent $event
  57.     //  */
  58.     // public function onRenderBlockCategoryNavPc(TemplateEvent $event)
  59.     // {
  60.     //     $event->addSnippet('@tbsCategoryImage/default/Block/category_nav_pc.twig');
  61.     // }
  62.     //
  63.     // /**
  64.     //  * カテゴリナビ(SP)にカテゴリアイコンを表示する.
  65.     //  *
  66.     //  * @param TemplateEvent $event
  67.     //  */
  68.     // public function onRenderBlockCategoryNavSp(TemplateEvent $event)
  69.     // {
  70.     //     $event->addSnippet('@tbsCategoryImage/default/Block/category_nav_sp.twig');
  71.     // }
  72. }