app/Plugin/BulkPurchase4/Event.php line 25

Open in your IDE?
  1. <?php
  2. namespace Plugin\BulkPurchase4;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Eccube\Event\TemplateEvent;
  5. class Event implements EventSubscriberInterface
  6. {
  7.     public function __construct(\Twig_Environment $twig)
  8.     {
  9.         $this->twig $twig;
  10.     }
  11.     /**
  12.      * @return array
  13.      */
  14.     public static function getSubscribedEvents()
  15.     {
  16.         return [
  17.             'Product/list.twig' => ['onTemplateRroductList'999999]
  18.         ];
  19.     }
  20.     public function onTemplateRroductList(TemplateEvent $event)
  21.     {
  22.         $source $this->twig->getLoader()
  23.             ->getSourceContext("@BulkPurchase4/default/Product/list.twig")
  24.             ->getCode();
  25.         $event->setSource($source);
  26.     }
  27. }