Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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

Embed.php

Zuletzt modifiziert: 09.10.2024, 12:58 - Dateigröße: 1.60 KiB


01  <?php
02   
03  /*
04   * This file is part of Twig.
05   *
06   * (c) 2012 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  /**
13   * Embeds a template.
14   */
15  class Twig_TokenParser_Embed extends Twig_TokenParser_Include
16  {
17      public function parse(Twig_Token $token)
18      {
19          $stream = $this->parser->getStream();
20   
21          $parent = $this->parser->getExpressionParser()->parseExpression();
22   
23          list($variables, $only, $ignoreMissing) = $this->parseArguments();
24   
25          // inject a fake parent to make the parent() function work
26          $stream->injectTokens(array(
27              new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', $token->getLine()),
28              new Twig_Token(Twig_Token::NAME_TYPE, 'extends', $token->getLine()),
29              new Twig_Token(Twig_Token::STRING_TYPE, '__parent__', $token->getLine()),
30              new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', $token->getLine()),
31          ));
32   
33          $module = $this->parser->parse($stream, array($this, 'decideBlockEnd'), true);
34   
35          // override the parent with the correct one
36          $module->setNode('parent', $parent);
37   
38          $this->parser->embedTemplate($module);
39   
40          $stream->expect(Twig_Token::BLOCK_END_TYPE);
41   
42          return new Twig_Node_Embed($module->getAttribute('filename'), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
43      }
44   
45      public function decideBlockEnd(Twig_Token $token)
46      {
47          return $token->test('endembed');
48      }
49   
50      public function getTag()
51      {
52          return 'embed';
53      }
54  }
55