Exemple #1
0
 /**
  * Constructor.
  *
  * @param \Twig_Environment           $environment A \Twig_Environment instance
  * @param TemplateNameParserInterface $parser      A TemplateNameParserInterface instance
  * @param FileLocatorInterface        $locator     A FileLocatorInterface instance
  * @param GlobalVariables|null        $globals     A GlobalVariables instance or null
  */
 public function __construct(\Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator, GlobalVariables $globals = null)
 {
     parent::__construct($environment, $parser);
     $this->locator = $locator;
     if (null !== $globals) {
         $environment->addGlobal('app', $globals);
     }
 }
 /**
  * Constructor.
  *
  * @param \Twig_Environment           $environment A \Twig_Environment instance
  * @param TemplateNameParserInterface $parser      A TemplateNameParserInterface instance
  * @param FileLocatorInterface        $locator     A FileLocatorInterface instance
  */
 public function __construct(\Twig_Environment $environment, TemplateNameParserInterface $parser, FileLocatorInterface $locator)
 {
     parent::__construct($environment, $parser);
     $this->locator = $locator;
 }