custom/plugins/zenitPlatformStratus/src/Subscriber/StorefrontRenderSubscriber.php line 24

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