<?php
namespace Plugin\CategoryImagePlugin42;
use Eccube\Event\EventArgs;
use Eccube\Event\TemplateEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class Event implements EventSubscriberInterface
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'@admin/Product/category.twig' => 'onRenderAdminProductCategory',
'Product/list.twig' => 'onRenderProductList',
];
}
/**
* 管理画面カテゴリ登録に画像ボタンを表示する.
*
* @param TemplateEvent $event
*/
public function onRenderAdminProductCategory(TemplateEvent $event)
{
$event->addSnippet('@CategoryImagePlugin42/admin/Product/category.twig');
}
/**
* 商品一覧にカテゴリバナーを表示する.
*
* @param TemplateEvent $event
*/
public function onRenderProductList(TemplateEvent $event)
{
$event->addSnippet('@CategoryImagePlugin42/default/Product/list.twig');
}
}