app/Plugin/RegionalShippingFee42/Event.php line 29

Open in your IDE?
  1. <?php
  2. namespace Plugin\RegionalShippingFee42;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. use Eccube\Event\TemplateEvent;
  5. /**
  6. * カートページを特定地域送料設定プラグイン用に差し替え
  7. */
  8. class Event implements EventSubscriberInterface
  9. {
  10.     public function __construct(\Twig\Environment $twig)
  11.     {
  12.         $this->twig $twig;
  13.     }
  14.     
  15.     /**
  16.      * @return array
  17.      */
  18.     public static function getSubscribedEvents()
  19.     {
  20.         return [
  21.             'Cart/index.twig' => ['onTemplateCartIndex'999999]
  22.         ];
  23.     }
  24.     
  25.     public function onTemplateCartIndex(TemplateEvent $event)
  26.     {
  27.         $source $this->twig->getLoader()
  28.             ->getSourceContext("@RegionalShippingFee42/default/Cart/index.twig")
  29.             ->getCode();
  30.                 
  31.         $event->setSource($source);
  32.     }
  33. }