<?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\ManufacturingBundle\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' => 'manufacturing_bundle',
'controllers' => [
[
'name' => 'manufacturing--product-options',
'routes' => [
'products_bundle__product_new_sheet',
'products_bundle__product_sheet'
]
]
]
]
];
$event->addJavascripts($javascripts);
}
}