app/Plugin/CouponPro42/CouponEvent.php line 83

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the CouponPro42 Plugin
  4.  *
  5.  * Copyright (C) 2022 Diezon.
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Plugin\CouponPro42;
  11. use Eccube\Event\TemplateEvent;
  12. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  13. class CouponEvent implements EventSubscriberInterface
  14. {
  15.     /**
  16.      * @return array
  17.      */
  18.     public static function getSubscribedEvents()
  19.     {
  20.         return [
  21.             'Mypage/index.twig' => 'onDefaultMypageNaviTwig',
  22.             'Mypage/history.twig' => [['onDefaultMypageNaviTwig'],['onDefaultMypageHistoryNaviTwig']],
  23.             'Mypage/favorite.twig' => 'onDefaultMypageNaviTwig',
  24.             'Mypage/change.twig' => 'onDefaultMypageNaviTwig',
  25.             'Mypage/change_complete.twig' => 'onDefaultMypageNaviTwig',
  26.             'Mypage/delivery.twig' => 'onDefaultMypageNaviTwig',
  27.             'Mypage/delivery_edit.twig' => 'onDefaultMypageNaviTwig',
  28.             'Mypage/withdraw.twig' => 'onDefaultMypageNaviTwig',
  29.             'Mypage/coupon_list.twig' => 'onDefaultMypageNaviTwig',
  30.             'Product/detail.twig' => 'onDefaultProductNaviTwig',
  31.             'Shopping/index.twig' => 'onDefaultShoppingIndexNaviTwig',
  32.             'Shopping/confirm.twig' => 'onDefaultShoppingConfirmNaviTwig',
  33.         ];
  34.     }
  35.     /**
  36.      * @param TemplateEvent $event
  37.      */
  38.     public function onDefaultMypageNaviTwig(TemplateEvent $event)
  39.     {
  40.         $event->addSnippet('@CouponPro42/front/Mypage/navi.twig');
  41.     }
  42.     /**
  43.      * @param TemplateEvent $event
  44.      */
  45.     public function onDefaultProductNaviTwig(TemplateEvent $event)
  46.     {
  47.         $event->addSnippet('@CouponPro42/front/Product/detail.twig');
  48.     }
  49.     /**
  50.      * @param TemplateEvent $event
  51.      */
  52.     public function onDefaultShoppingIndexNaviTwig(TemplateEvent $event)
  53.     {
  54.         $event->addSnippet('@CouponPro42/front/Shopping/coupon_list.twig');
  55.     }
  56.     /**
  57.      * @param TemplateEvent $event
  58.      */
  59.     public function onDefaultShoppingConfirmNaviTwig(TemplateEvent $event)
  60.     {
  61.         $event->addSnippet('@CouponPro42/front/Shopping/confirm_coupon.twig');
  62.     }
  63.     /**
  64.      * @param TemplateEvent $event
  65.      */
  66.     public function onDefaultOrderEditNaviTwig(TemplateEvent $event)
  67.     {
  68.         $event->addSnippet('@CouponPro42/admin/Order/coupon.twig');
  69.     }
  70.     /**
  71.      * @param TemplateEvent $event
  72.      */
  73.     public function onDefaultMypageHistoryNaviTwig(TemplateEvent $event)
  74.     {
  75.         $event->addSnippet('@CouponPro42/front/History/coupon.twig');
  76.     }
  77. }