custom/plugins/RHWebBasicTheme/src/Subscriber/StorefrontSubscriber.php line 24

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace RHWeb\BasicTheme\Subscriber;
  3. use Shopware\Core\Framework\Struct\ArrayEntity;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Shopware\Storefront\Event\StorefrontRenderEvent;
  6. class StorefrontSubscriber implements EventSubscriberInterface
  7. {
  8.     /**
  9.      * @var string
  10.      */
  11.     private $themeType 'RHWebSelfHostedTheme';
  12.     public static function getSubscribedEvents(): array
  13.     {
  14.         return [
  15.             StorefrontRenderEvent::class => 'addThemeType',
  16.         ];
  17.     }
  18.     public function addThemeType(StorefrontRenderEvent $event)
  19.     {
  20.         $config = [];
  21.         $config['selfHosted'] = true;
  22.         $event->getContext()->addExtension($this->themeType, new ArrayEntity($config));
  23.     }
  24. }