Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ForLoopNode.php
01 <?php
02
03 /*
04 * This file is part of Twig.
05 *
06 * (c) Fabien Potencier
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Twig\Node;
13
14 use Twig\Compiler;
15
16 /**
17 * Internal node used by the for node.
18 *
19 * @author Fabien Potencier <fabien@symfony.com>
20 */
21 class ForLoopNode extends Node
22 {
23 public function __construct(int $lineno, string $tag = null)
24 {
25 parent::__construct([], ['with_loop' => false, 'ifexpr' => false, 'else' => false], $lineno, $tag);
26 }
27
28 public function compile(Compiler $compiler)
29 {
30 if ($this->getAttribute('else')) {
31 $compiler->write("\$context['_iterated'] = true;\n");
32 }
33
34 if ($this->getAttribute('with_loop')) {
35 $compiler
36 ->write("++\$context['loop']['index0'];\n")
37 ->write("++\$context['loop']['index'];\n")
38 ->write("\$context['loop']['first'] = false;\n")
39 ;
40
41 if (!$this->getAttribute('ifexpr')) {
42 $compiler
43 ->write("if (isset(\$context['loop']['length'])) {\n")
44 ->indent()
45 ->write("--\$context['loop']['revindex0'];\n")
46 ->write("--\$context['loop']['revindex'];\n")
47 ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n")
48 ->outdent()
49 ->write("}\n")
50 ;
51 }
52 }
53 }
54 }
55
56 class_alias('Twig\Node\ForLoopNode', 'Twig_Node_ForLoop');
57