From: Fabien Potencier Date: Fri, 30 Sep 2011 14:40:46 +0000 (+0200) Subject: fixed wrong node type for the for tag X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=d340339ae02e8c918abb5835e3feaa10137e9e80;p=web%2Fkonrad%2Ftwig.git fixed wrong node type for the for tag --- 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());