From 1a741e500f0288852cdf7e52dfb5b9075090857f Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sat, 12 Nov 2011 22:54:54 +0100 Subject: Foreach counter bug fixed. The current counter value was not set prorperly. --- stupid_template_engine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stupid_template_engine.php') diff --git a/stupid_template_engine.php b/stupid_template_engine.php index ba840f0..69e5772 100644 --- a/stupid_template_engine.php +++ b/stupid_template_engine.php @@ -670,7 +670,7 @@ $ste_builtins = array( $loopbody .= "\$${loopname}_counter++;\n\$ste->set_var_by_name(\$${loopname}_countervar, \$${loopname}_counter);\n"; } - $loopbody = "\$ste->set_var_by_name(\$${loopname}_valuevar, \$${loopname}_value);\n"; + $loopbody .= "\$ste->set_var_by_name(\$${loopname}_valuevar, \$${loopname}_value);\n"; if(!empty($ast->params["key"])) $loopbody .= "\$ste->set_var_by_name(\$${loopname}_keyvar, \$${loopname}_key);\n"; $loopbody .= "\n"; -- cgit v1.2.3-70-g09d2