/** * Constructor. * * @param ContainerInterface $container A ContainerInterface instance * @param LoaderInterface $loader A loader instance * @param array $renderers An array of renderer instances * @param mixed $escaper The escaper to use (or false to disable escaping) */ public function __construct(ContainerInterface $container, LoaderInterface $loader, array $renderers = array(), $escaper = false) { $this->container = $container; $this->escaper = $escaper; parent::__construct($loader, $renderers); foreach ($this->container->findTaggedServiceIds('templating.renderer') as $id => $attributes) { if (isset($attributes[0]['alias'])) { $this->renderers[$attributes[0]['alias']] = $id; } } $this->helpers = array(); foreach ($this->container->findTaggedServiceIds('templating.helper') as $id => $attributes) { if (isset($attributes[0]['alias'])) { $this->helpers[$attributes[0]['alias']] = $id; } } }
/** * Constructor. * * @param ContainerInterface $container The DI container * @param LoaderInterface $loader A loader instance * @param array $renderers All templating renderers */ public function __construct(ContainerInterface $container, LoaderInterface $loader, array $renderers) { $this->container = $container; parent::__construct($loader, $renderers); }