src/Listener/TemplateGlobals.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Listener;
  3. use App\Repository\AppSettingRepository;
  4. use Symfony\Component\HttpKernel\Event\RequestEvent;
  5. use Twig\Environment;
  6. class TemplateGlobals
  7. {
  8.     public function __construct(private AppSettingRepository $repository, private Environment $template)
  9.     {
  10.     }
  11.     public function __invoke(RequestEvent $event)
  12.     {
  13.         // $this->template->addGlobal(AppSetting::APP_TITLE, $this->repository->value(AppSetting::APP_TITLE));
  14.         // $this->template->addGlobal(AppSetting::APP_CONTACT, $this->repository->value(AppSetting::APP_CONTACT));
  15.         // $this->template->addGlobal(AppSetting::APP_PHONE, $this->repository->value(AppSetting::APP_PHONE));
  16.     }
  17. }