app/Plugin/BundleSale4/Event.php line 35

Open in your IDE?
  1. <?php
  2. /**
  3.  * This file is part of BundleSale4
  4.  *
  5.  * Copyright(c) Akira Kurozumi <info@a-zumi.net>
  6.  *
  7.  * https://a-zumi.net
  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\BundleSale4;
  13. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  14. use Eccube\Event\TemplateEvent;
  15. class Event implements EventSubscriberInterface
  16. {
  17.     /**
  18.      * @return array
  19.      */
  20.     public static function getSubscribedEvents()
  21.     {
  22.         return [
  23.             '@admin/Product/product.twig' => 'onRenderAdminProduct',
  24.         ];
  25.     }
  26.     /**
  27.      * 管理画面:商品登録画面にセット商品登録フォームを表示する.
  28.      *
  29.      * @param TemplateEvent $event
  30.      */
  31.     public function onRenderAdminProduct(TemplateEvent $event)
  32.     {
  33.         if(!$event->getParameter("has_class")) {
  34.             $event->addSnippet('@BundleSale4/admin/bundle_item.twig');
  35.         }
  36.     }
  37. }