vendor/bluue/shipments-picture-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\ShipmentsPictureBundle\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' => 'shipments_picture_bundle',
  31.                 'controllers' => [
  32.                     [
  33.                         'name' => 'shipments-picture--camera',
  34.                         'routes' => [
  35.                             'shipments_bundle__burst_sheet',
  36.                             'shipments_bundle__burst_sheet_advanced_order_preparation',
  37.                             'sales_bundle__order_view'
  38.                         ]
  39.                     ]
  40.                 ]
  41.             ]
  42.         ];
  43.         $event->addJavascripts($javascripts);
  44.     }
  45. }