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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

FilterTokenParser.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.86 KiB


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\BlockNode;
15  use Twig\Node\Expression\BlockReferenceExpression;
16  use Twig\Node\Expression\ConstantExpression;
17  use Twig\Node\PrintNode;
18  use Twig\Token;
19   
20  /**
21   * Filters a section of a template by applying filters.
22   *
23   *   {% filter upper %}
24   *      This text becomes uppercase
25   *   {% endfilter %}
26   *
27   * @deprecated since Twig 2.9, to be removed in 3.0 (use the "apply" tag instead)
28   */
29  final class FilterTokenParser extends AbstractTokenParser
30  {
31      public function parse(Token $token)
32      {
33          $stream = $this->parser->getStream();
34          $lineno = $token->getLine();
35   
36          @trigger_error(sprintf('The "filter" tag in "%s" at line %d is deprecated since Twig 2.9, use the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED);
37   
38          $name = $this->parser->getVarName();
39          $ref = new BlockReferenceExpression(new ConstantExpression($name, $lineno), null, $lineno, $this->getTag());
40   
41          $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag());
42          $stream->expect(/* Token::BLOCK_END_TYPE */ 3);
43   
44          $body = $this->parser->subparse([$this, 'decideBlockEnd'], true);
45          $stream->expect(/* Token::BLOCK_END_TYPE */ 3);
46   
47          $block = new BlockNode($name, $body, $lineno);
48          $this->parser->setBlock($name, $block);
49   
50          return new PrintNode($filter, $lineno, $this->getTag());
51      }
52   
53      public function decideBlockEnd(Token $token)
54      {
55          return $token->test('endfilter');
56      }
57   
58      public function getTag()
59      {
60          return 'filter';
61      }
62  }
63   
64  class_alias('Twig\TokenParser\FilterTokenParser', 'Twig_TokenParser_Filter');
65