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 |
ExtendsTokenParser.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\Error\SyntaxError;
16 use Twig\Node\Node;
17 use Twig\Token;
18
19 /**
20 * Extends a template by another one.
21 *
22 * {% extends "base.html" %}
23 */
24 final class ExtendsTokenParser extends AbstractTokenParser
25 {
26 public function parse(Token $token)
27 {
28 $stream = $this->parser->getStream();
29
30 if ($this->parser->peekBlockStack()) {
31 throw new SyntaxError('Cannot use "extend" in a block.', $token->getLine(), $stream->getSourceContext());
32 } elseif (!$this->parser->isMainScope()) {
33 throw new SyntaxError('Cannot use "extend" in a macro.', $token->getLine(), $stream->getSourceContext());
34 }
35
36 if (null !== $this->parser->getParent()) {
37 throw new SyntaxError('Multiple extends tags are forbidden.', $token->getLine(), $stream->getSourceContext());
38 }
39 $this->parser->setParent($this->parser->getExpressionParser()->parseExpression());
40
41 $stream->expect(Token::BLOCK_END_TYPE);
42
43 return new Node();
44 }
45
46 public function getTag()
47 {
48 return 'extends';
49 }
50 }
51
52 class_alias('Twig\TokenParser\ExtendsTokenParser', 'Twig_TokenParser_Extends');
53