1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[feature/twig] BEGIN loops now work

PHPBB3-11598
This commit is contained in:
Nathan Guse
2013-06-10 11:57:51 -05:00
parent 15114067e6
commit eac3c1f75c
2 changed files with 4 additions and 5 deletions

View File

@@ -45,10 +45,9 @@ class phpbb_template_twig_node_begin extends Twig_Node
}
$compiler
->write("if (isset(\$context['loop'])) {")
->write("foreach (\$context['loop']['")
->write($this->getAttribute('beginName'))
->write("'] as \$loops[\$nestingLevel]['i'] => \$loops[\$nestingLevel]['values']) {")
->write("if (isset(\$context['loop']['" . $this->getAttribute('beginName') . "'])) {")
->write("foreach (\$context['loop']['". $this->getAttribute('beginName'). "'] as \$" . $this->getAttribute('beginName') . ") {")
->write("\$context['". $this->getAttribute('beginName'). "'] = \$" . $this->getAttribute('beginName') . ";")
->indent()
;