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

definenode.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 1.35 KiB


 01  <?php
 02  /**
 03  *
 04  * This file is part of the phpBB Forum Software package.
 05  *
 06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 07  * @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher
 08  * @license GNU General Public License, version 2 (GPL-2.0)
 09  *
 10  * For full copyright and license information, please see
 11  * the docs/CREDITS.txt file.
 12  *
 13  */
 14   
 15  namespace phpbb\template\twig\node;
 16   
 17   
 18  class definenode extends \Twig_Node
 19  {
 20      public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null)
 21      {
 22          parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag);
 23      }
 24   
 25      /**
 26      * Compiles the node to PHP.
 27      *
 28      * @param \Twig_Compiler A Twig_Compiler instance
 29      */
 30      public function compile(\Twig_Compiler $compiler)
 31      {
 32          $compiler->addDebugInfo($this);
 33   
 34          if ($this->getAttribute('capture')) {
 35              $compiler
 36                  ->write("ob_start();\n")
 37                  ->subcompile($this->getNode('value'))
 38              ;
 39   
 40              $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new \Twig_Markup(\$value, \$this->env->getCharset());\n");
 41          }
 42          else
 43          {
 44              $compiler
 45                  ->write("\$value = ")
 46                  ->subcompile($this->getNode('value'))
 47                  ->raw(";\n")
 48              ;
 49          }
 50   
 51          $compiler
 52              ->write("\$context['definition']->set('")
 53              ->raw($this->getNode('name')->getAttribute('name'))
 54              ->raw("', \$value);\n")
 55          ;
 56      }
 57  }
 58