src/Listener/ConfigureArticleWidgetSubscriber.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Listener;
  3. use Moka\Cms\Event\ArticleWidgetThemeEvent;
  4. use Symfony\Component\Asset\Packages;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class ConfigureArticleWidgetSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents(): array
  9.     {
  10.         return [
  11.             ArticleWidgetThemeEvent::NAME => 'configure',
  12.         ];
  13.     }
  14.     public function __construct(private Packages $packages)
  15.     {
  16.     }
  17.     public function configure(ArticleWidgetThemeEvent $event): void
  18.     {
  19.         $event->merge([
  20.             'custom' => [
  21.                 'css' => [$this->packages->getUrl('build/style-article.css')],
  22.                 'js' => [$this->packages->getUrl('build/app.js')],
  23.             ],
  24.         ]);
  25.     }
  26. }