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 |
IncludeTokenParser.php
01 <?php
02
03 /*
04 * This file is part of Twig.
05 *
06 * (c) Fabien Potencier
07 * (c) Armin Ronacher
08 *
09 * For the full copyright and license information, please view the LICENSE
10 * file that was distributed with this source code.
11 */
12
13 namespace Twig\TokenParser;
14
15 use Twig\Node\IncludeNode;
16 use Twig\Token;
17
18 /**
19 * Includes a template.
20 *
21 * {% include 'header.html' %}
22 * Body
23 * {% include 'footer.html' %}
24 */
25 class IncludeTokenParser extends AbstractTokenParser
26 {
27 public function parse(Token $token)
28 {
29 $expr = $this->parser->getExpressionParser()->parseExpression();
30
31 list($variables, $only, $ignoreMissing) = $this->parseArguments();
32
33 return new IncludeNode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
34 }
35
36 protected function parseArguments()
37 {
38 $stream = $this->parser->getStream();
39
40 $ignoreMissing = false;
41 if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'ignore')) {
42 $stream->expect(/* Token::NAME_TYPE */ 5, 'missing');
43
44 $ignoreMissing = true;
45 }
46
47 $variables = null;
48 if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'with')) {
49 $variables = $this->parser->getExpressionParser()->parseExpression();
50 }
51
52 $only = false;
53 if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'only')) {
54 $only = true;
55 }
56
57 $stream->expect(/* Token::BLOCK_END_TYPE */ 3);
58
59 return [$variables, $only, $ignoreMissing];
60 }
61
62 public function getTag()
63 {
64 return 'include';
65 }
66 }
67
68 class_alias('Twig\TokenParser\IncludeTokenParser', 'Twig_TokenParser_Include');
69