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 |
WithTokenParser.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\TokenParser;
13
14 use Twig\Node\WithNode;
15 use Twig\Token;
16
17 /**
18 * Creates a nested scope.
19 *
20 * @author Fabien Potencier <fabien@symfony.com>
21 */
22 final class WithTokenParser extends AbstractTokenParser
23 {
24 public function parse(Token $token)
25 {
26 $stream = $this->parser->getStream();
27
28 $variables = null;
29 $only = false;
30 if (!$stream->test(/* Token::BLOCK_END_TYPE */ 3)) {
31 $variables = $this->parser->getExpressionParser()->parseExpression();
32 $only = (bool) $stream->nextIf(/* Token::NAME_TYPE */ 5, 'only');
33 }
34
35 $stream->expect(/* Token::BLOCK_END_TYPE */ 3);
36
37 $body = $this->parser->subparse([$this, 'decideWithEnd'], true);
38
39 $stream->expect(/* Token::BLOCK_END_TYPE */ 3);
40
41 return new WithNode($body, $variables, $only, $token->getLine(), $this->getTag());
42 }
43
44 public function decideWithEnd(Token $token)
45 {
46 return $token->test('endwith');
47 }
48
49 public function getTag()
50 {
51 return 'with';
52 }
53 }
54
55 class_alias('Twig\TokenParser\WithTokenParser', 'Twig_TokenParser_With');
56