<?php
namespace Plugin\ApexReceipt;
use Eccube\Entity\Order;
use Eccube\Event\TemplateEvent;
use Plugin\ApexReceipt\Form\Type\ReceiptType;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormFactoryInterface;
class Event implements EventSubscriberInterface
{
/**
* Event constructor.
*
* @param FormFactoryInterface $formFactory
*/
public function __construct(FormFactoryInterface $formFactory) {
$this->formFactory = $formFactory;
}
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'Mypage/index.twig' => 'onRenderMypageIndex',
'Mypage/history.twig' => 'onRenderMypageHistory',
];
}
public function onRenderMypageIndex(TemplateEvent $event)
{
$twig = '@ApexReceipt/default/Mypage/receipt_js.twig';
$event->addSnippet($twig);
}
public function onRenderMypageHistory(TemplateEvent $event)
{
$twig = '@ApexReceipt/default/Mypage/receipt_js.twig';
$event->addSnippet($twig);
}
}