custom/static-plugins/WebkulKeycloakSso/src/Subscriber/AccountPageSubscriber.php line 28

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace WebkulKeyCloakSSO\Subscriber;
  3. use Shopware\Core\System\SystemConfig\SystemConfigService;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Shopware\Storefront\Pagelet\Footer\FooterPageletLoadedEvent;
  6. class AccountPageSubscriber implements EventSubscriberInterface
  7. {
  8.     /**
  9.      * @var SystemConfigService 
  10.      */
  11.     private $systemConfigService;
  12.     public function __construct(SystemConfigService $systemConfigService)
  13.     {
  14.         $this->systemConfigService $systemConfigService;
  15.     }
  16.     public static function getSubscribedEvents(): array
  17.     {
  18.         return [
  19.             FooterPageletLoadedEvent::class => 'onAccountPageLoaded'
  20.         ];
  21.     }
  22.     
  23.     public function onAccountPageLoaded(FooterPageletLoadedEvent $event): void
  24.     {
  25.         $wkKeyCloakSSOConfig $this->systemConfigService->get('WebkulKeyCloakSSO.config');
  26.         // echo '<pre>';
  27.         // print_r(get_class_methods($event->getPagelet()));
  28.         // echo '</pre>';
  29.         // die();
  30.         $event->getPagelet()->assign($wkKeyCloakSSOConfig'wkKeyCloakSSOConfig');
  31.     }
  32. }