Ejemplo n.º 1
0
 /**
  * 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)
 {
     parent::__construct($loader, $renderers);
     $this->level = 0;
     $this->container = $container;
     $this->escaper = $escaper;
     $this->helpers = array();
     foreach ($this->container->findAnnotatedServiceIds('templating.helper') as $id => $attributes) {
         if (isset($attributes[0]['alias'])) {
             $this->helpers[$attributes[0]['alias']] = $id;
         }
     }
 }