vendor/bluue/accounting-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\AccountingBundle\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' => 'accounting_bundle',
  31.                 'controllers' => [
  32.                     [
  33.                         'name' => 'accounting--select-account',
  34.                         'routes' => [
  35.                             'app_configuration_tax',
  36.                             'sales_bundle__configuration_bank_list'
  37.                         ]
  38.                     ]
  39.                 ]
  40.             ]
  41.         ];
  42.         $event->addJavascripts($javascripts);
  43.     }
  44. }