vendor/romeniwebdesign/contao-custom-articles-bundle/src/EventSubscriber/KernelRequestSubscriber.php line 34

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of Custom Article for Contao Open Source CMS.
  5.  *
  6.  * (c) Christian Romeni
  7.  *
  8.  * @license LGPL-3.0-or-later
  9.  */
  10. namespace Rwd\ContaoCustomArticlesBundle\EventSubscriber;
  11. use Contao\CoreBundle\Routing\ScopeMatcher;
  12. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  13. use Symfony\Component\HttpKernel\Event\RequestEvent;
  14. use Symfony\Component\HttpKernel\KernelEvents;
  15. class KernelRequestSubscriber implements EventSubscriberInterface
  16. {
  17.     protected $scopeMatcher;
  18.     public function __construct(ScopeMatcher $scopeMatcher)
  19.     {
  20.         $this->scopeMatcher $scopeMatcher;
  21.     }
  22.     public static function getSubscribedEvents(): array
  23.     {
  24.         return [KernelEvents::REQUEST => 'onKernelRequest'];
  25.     }
  26.     public function onKernelRequest(RequestEvent $e): void
  27.     {
  28.         $request $e->getRequest();
  29.         if ($this->scopeMatcher->isBackendRequest($request)) {
  30.             $GLOBALS['TL_CSS'][] = '/bundles/contaocustomarticles/assets/extend-backend.css|static';
  31.         }
  32.     }
  33. }