<?php
namespace App\Listener;
use Moka\Cms\Event\ArticleWidgetThemeEvent;
use Symfony\Component\Asset\Packages;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ConfigureArticleWidgetSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
ArticleWidgetThemeEvent::NAME => 'configure',
];
}
public function __construct(private Packages $packages)
{
}
public function configure(ArticleWidgetThemeEvent $event): void
{
$event->merge([
'custom' => [
'css' => [$this->packages->getUrl('build/style-article.css')],
'js' => [$this->packages->getUrl('build/app.js')],
],
]);
}
}