From: Fabien Potencier Date: Thu, 30 Dec 2010 20:48:36 +0000 (+0100) Subject: fixed optimizer X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=bd541f618f733a1352e207599da1ffd1b46f4c9a;p=web%2Fkonrad%2Ftwig.git fixed optimizer --- diff --git a/lib/Twig/NodeVisitor/Optimizer.php b/lib/Twig/NodeVisitor/Optimizer.php index c149747..87b38e2 100644 --- a/lib/Twig/NodeVisitor/Optimizer.php +++ b/lib/Twig/NodeVisitor/Optimizer.php @@ -113,6 +113,11 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface $this->addLoopToCurrent(); } + // block reference + elseif ($node instanceof Twig_Node_BlockReference || $node instanceof Twig_Node_Expression_BlockReference) { + $this->addLoopToCurrent(); + } + // include without the only attribute elseif ($node instanceof Twig_Node_Include && !$node->getAttribute('only')) { $this->addLoopToAll();