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

Spaceless.php

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


01  <?php
02   
03  /*
04   * This file is part of Twig.
05   *
06   * (c) 2010 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   * Remove whitespaces between HTML tags.
14   *
15   * <pre>
16   * {% spaceless %}
17   *      <div>
18   *          <strong>foo</strong>
19   *      </div>
20   * {% endspaceless %}
21   *
22   * {# output will be <div><strong>foo</strong></div> #}
23   * </pre>
24   */
25  class Twig_TokenParser_Spaceless extends Twig_TokenParser
26  {
27      public function parse(Twig_Token $token)
28      {
29          $lineno = $token->getLine();
30   
31          $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
32          $body = $this->parser->subparse(array($this, 'decideSpacelessEnd'), true);
33          $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
34   
35          return new Twig_Node_Spaceless($body, $lineno, $this->getTag());
36      }
37   
38      public function decideSpacelessEnd(Twig_Token $token)
39      {
40          return $token->test('endspaceless');
41      }
42   
43      public function getTag()
44      {
45          return 'spaceless';
46      }
47  }
48