From d340339ae02e8c918abb5835e3feaa10137e9e80 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Sep 2011 16:40:46 +0200 Subject: [PATCH] fixed wrong node type for the for tag --- lib/Twig/TokenParser/For.php | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/lib/Twig/TokenParser/For.php b/lib/Twig/TokenParser/For.php index 5ce8297..39755a4 100644 --- a/lib/Twig/TokenParser/For.php +++ b/lib/Twig/TokenParser/For.php @@ -55,10 +55,13 @@ class Twig_TokenParser_For extends Twig_TokenParser if (count($targets) > 1) { $keyTarget = $targets->getNode(0); + $keyTarget = new Twig_Node_Expression_AssignName($keyTarget->getAttribute('name'), $keyTarget->getLine()); $valueTarget = $targets->getNode(1); + $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine()); } else { $keyTarget = new Twig_Node_Expression_AssignName('_key', $lineno); $valueTarget = $targets->getNode(0); + $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine()); } return new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag()); -- 1.7.2.5