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 |
AutoEscapeTokenParser.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\Error\SyntaxError;
15 use Twig\Node\AutoEscapeNode;
16 use Twig\Node\Expression\ConstantExpression;
17 use Twig\Token;
18
19 /**
20 * Marks a section of a template to be escaped or not.
21 */
22 final class AutoEscapeTokenParser extends AbstractTokenParser
23 {
24 public function parse(Token $token)
25 {
26 $lineno = $token->getLine();
27 $stream = $this->parser->getStream();
28
29 if ($stream->test(/* Token::BLOCK_END_TYPE */ 3)) {
30 $value = 'html';
31 } else {
32 $expr = $this->parser->getExpressionParser()->parseExpression();
33 if (!$expr instanceof ConstantExpression) {
34 throw new SyntaxError('An escaping strategy must be a string or false.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
35 }
36 $value = $expr->getAttribute('value');
37 }
38
39 $stream->expect(/* Token::BLOCK_END_TYPE */ 3);
40 $body = $this->parser->subparse([$this, 'decideBlockEnd'], true);
41 $stream->expect(/* Token::BLOCK_END_TYPE */ 3);
42
43 return new AutoEscapeNode($value, $body, $lineno, $this->getTag());
44 }
45
46 public function decideBlockEnd(Token $token)
47 {
48 return $token->test('endautoescape');
49 }
50
51 public function getTag()
52 {
53 return 'autoescape';
54 }
55 }
56
57 class_alias('Twig\TokenParser\AutoEscapeTokenParser', 'Twig_TokenParser_AutoEscape');
58