<?php
/**
* @author Quentin CHATELAIN (contact@scaledev.fr)
* @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
* @license commercial
*/
declare(strict_types=1);
namespace Bluue\CategoriesBundle\EventSubscriber;
use App\Event\AdditionalJavascriptsEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class AdditionalJavascriptsSubscriber implements EventSubscriberInterface
{
/**
* @return string[]
*/
public static function getSubscribedEvents(): array
{
return [
AdditionalJavascriptsEvent::NAME => 'onLoad'
];
}
/**
* @param AdditionalJavascriptsEvent $event
* @return void
*/
public function onLoad(AdditionalJavascriptsEvent $event): void
{
$javascripts = [
[
'entry' => 'categories_bundle',
'controllers' => [
[
'name' => 'categories--category-products-list',
'routes' => [
'products_bundle__product_new_sheet',
'products_bundle__product_sheet'
]
]
]
]
];
$event->addJavascripts($javascripts);
}
}