app/Plugin/RelatedProduct4/RelatedProductEvent.php line 44

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\RelatedProduct4;
  13. use Eccube\Event\TemplateEvent;
  14. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  15. class RelatedProductEvent implements EventSubscriberInterface
  16. {
  17.     public static function getSubscribedEvents()
  18.     {
  19.         return [
  20.             '@admin/Product/product.twig' => 'onRenderAdminProduct',
  21. //            'Product/detail.twig' => 'onRenderProductDetail',
  22.         ];
  23.     }
  24.     /**
  25.      * フロント:商品詳細画面に関連商品を表示する.
  26.      *
  27.      * @param TemplateEvent $event
  28.      */
  29.     public function onRenderProductDetail(TemplateEvent $event)
  30.     {
  31.         $event->addSnippet('@RelatedProduct4/front/related_product.twig');
  32.     }
  33.     /**
  34.      * 管理画面:商品登録画面に関連商品登録フォームを表示する.
  35.      *
  36.      * @param TemplateEvent $event
  37.      */
  38.     public function onRenderAdminProduct(TemplateEvent $event)
  39.     {
  40.         $event->addSnippet('@RelatedProduct4/admin/related_product.twig');
  41.     }
  42. }