<?php
namespace Ecd\econdLoader\Storefront\Event\Subscriber;
use Shopware\Core\System\SystemConfig\SystemConfigService;
use Shopware\Storefront\Event\StorefrontRenderEvent;
use \Symfony\Component\EventDispatcher\EventSubscriberInterface;
class StorefrontRenderEventSubscriber implements EventSubscriberInterface
{
protected $systemConfigService;
/**
* StorefrontRenderEventSubscriber constructor.
* @param SystemConfigService $systemConfigService
*/
public function __construct(SystemConfigService $systemConfigService)
{
$this->systemConfigService = $systemConfigService;
}
/**
* @inheritDoc
*/public static function getSubscribedEvents()
{
return [
StorefrontRenderEvent::class => 'onStorefrontRenderEvent'
];
}
public function onStorefrontRenderEvent (StorefrontRenderEvent $event)
{
$config = $this->systemConfigService->getDomain('econdLoader');
$event->setParameter('ECL',$config);
}
}