From bd541f618f733a1352e207599da1ffd1b46f4c9a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Dec 2010 21:48:36 +0100 Subject: [PATCH] fixed optimizer --- lib/Twig/NodeVisitor/Optimizer.php | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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(); -- 1.7.2.5