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