Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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

Extends.php

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


 01  <?php
 02   
 03  /*
 04   * This file is part of Twig.
 05   *
 06   * (c) 2009 Fabien Potencier
 07   * (c) 2009 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  /**
 14   * Extends a template by another one.
 15   *
 16   * <pre>
 17   *  {% extends "base.html" %}
 18   * </pre>
 19   */
 20  class Twig_TokenParser_Extends extends Twig_TokenParser
 21  {
 22      /**
 23       * Parses a token and returns a node.
 24       *
 25       * @param Twig_Token $token A Twig_Token instance
 26       *
 27       * @return Twig_NodeInterface A Twig_NodeInterface instance
 28       */
 29      public function parse(Twig_Token $token)
 30      {
 31          if (!$this->parser->isMainScope()) {
 32              throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine(), $this->parser->getFilename());
 33          }
 34   
 35          if (null !== $this->parser->getParent()) {
 36              throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine(), $this->parser->getFilename());
 37          }
 38          $this->parser->setParent($this->parser->getExpressionParser()->parseExpression());
 39   
 40          $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
 41      }
 42   
 43      /**
 44       * Gets the tag name associated with this token parser.
 45       *
 46       * @return string The tag name
 47       */
 48      public function getTag()
 49      {
 50          return 'extends';
 51      }
 52  }
 53