/** * {@inheritdoc} */ protected function doEnterNode(Twig_Node $node, Twig_Environment $env) { $node = parent::doEnterNode($node, $env); if ($this->shouldProcess()) { if ($this->isAssetsInjectionNode($node)) { $this->shouldBufferizeBody = true; } } return $node; }
/** * {@inheritdoc} */ protected function doEnterNode(Twig_Node $node, Twig_Environment $env) { parent::doEnterNode($node, $env); if ($this->shouldProcess()) { if ($node instanceof Twig_Node_Module) { $this->blocks = $node->getNode('blocks')->getIterator()->getArrayCopy(); } if ($node instanceof Twig_Node_Body) { $this->currentScope = null; } if ($node instanceof Twig_Node_Block) { $this->currentScope = $node->getAttribute('name'); } } return $node; }