[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of the phpBB Forum Software package. 5 * 6 * @copyright (c) phpBB Limited <https://www.phpbb.com> 7 * @copyright Portions (c) 2009 Fabien Potencier, Armin Ronacher 8 * @license GNU General Public License, version 2 (GPL-2.0) 9 * 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 class definenode extends \Twig_Node 18 { 19 public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null) 20 { 21 parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag); 22 } 23 24 /** 25 * Compiles the node to PHP. 26 * 27 * @param \Twig_Compiler A Twig_Compiler instance 28 */ 29 public function compile(\Twig_Compiler $compiler) 30 { 31 $compiler->addDebugInfo($this); 32 33 if ($this->getAttribute('capture')) 34 { 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 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |