vendor/bluue/labels-bundle/src/EventSubscriber/AdditionalJavascriptsSubscriber.php line 32

Open in your IDE?
  1. <?php
  2. /**
  3.  * @author Quentin CHATELAIN (contact@scaledev.fr)
  4.  * @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
  5.  * @license commercial
  6.  */
  7. declare(strict_types=1);
  8. namespace Bluue\LabelsBundle\EventSubscriber;
  9. use App\Event\AdditionalJavascriptsEvent;
  10. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  11. class AdditionalJavascriptsSubscriber implements EventSubscriberInterface
  12. {
  13.     /**
  14.      * @return string[]
  15.      */
  16.     public static function getSubscribedEvents(): array
  17.     {
  18.         return [
  19.             AdditionalJavascriptsEvent::NAME => 'onLoad'
  20.         ];
  21.     }
  22.     /**
  23.      * @param AdditionalJavascriptsEvent $event
  24.      * @return void
  25.      */
  26.     public function onLoad(AdditionalJavascriptsEvent $event): void
  27.     {
  28.         $javascripts = [
  29.             [
  30.                 'entry' => 'labels_bundle',
  31.                 'controllers' => [
  32.                     [
  33.                         'name' => 'labels--product-form',
  34.                         'routes' => [
  35.                             'products_bundle__product_new_sheet',
  36.                             'products_bundle__product_sheet'
  37.                         ]
  38.                     ]
  39.                 ]
  40.             ]
  41.         ];
  42.         $event->addJavascripts($javascripts);
  43.     }
  44. }