瀏覽代碼

FrontendTwigExtension : ajout router

feature/export_comptable
Guillaume 4 年之前
父節點
當前提交
f9dcbb4dc8
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      ShopBundle/Twig/FrontendTwigExtension.php

+ 5
- 1
ShopBundle/Twig/FrontendTwigExtension.php 查看文件

@@ -13,6 +13,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Security;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
@@ -31,9 +32,11 @@ class FrontendTwigExtension extends AbstractExtension
protected $liipCacheHelper;
protected $parameterBag;
protected $kernel;
protected $router ;

public function __construct(EntityManagerInterface $em, Security $security, MerchantUtilsInterface $merchantUtils,
FormFactoryInterface $formFactory, RequestStack $requestStack, ParameterBagInterface $parameterBag, KernelInterface $kernel)
FormFactoryInterface $formFactory, RequestStack $requestStack, ParameterBagInterface $parameterBag,
KernelInterface $kernel, RouterInterface $router)
{
$this->em = $em;
$this->security = $security;
@@ -45,6 +48,7 @@ class FrontendTwigExtension extends AbstractExtension
$this->productFamilyRepository = $this->em->getRepository($this->em->getClassMetadata(ProductFamilyInterface::class)->getName());
$this->parameterBag = $parameterBag;
$this->kernel = $kernel;
$this->router = $router ;
}

public function getFunctions()

Loading…
取消
儲存