ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Parent.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) Fabien Potencier
7 * (c) Armin Ronacher
8 *
9 * For the full copyright and license information, please view the LICENSE
10 * file that was distributed with this source code.
11 */
12
19{
20 public function __construct($name, $lineno, $tag = null)
21 {
22 parent::__construct(array(), array('output' => false, 'name' => $name), $lineno, $tag);
23 }
24
25 public function compile(Twig_Compiler $compiler)
26 {
27 if ($this->getAttribute('output')) {
28 $compiler
29 ->addDebugInfo($this)
30 ->write('$this->displayParentBlock(')
31 ->string($this->getAttribute('name'))
32 ->raw(", \$context, \$blocks);\n")
33 ;
34 } else {
35 $compiler
36 ->raw('$this->renderParentBlock(')
37 ->string($this->getAttribute('name'))
38 ->raw(', $context, $blocks)')
39 ;
40 }
41 }
42}
43
44class_alias('Twig_Node_Expression_Parent', 'Twig\Node\Expression\ParentExpression', false);
An exception for terminatinating execution or to throw for unit testing.
Compiles a node to PHP code.
Definition: Compiler.php:19
raw($string)
Adds a raw string to the compiled code.
Definition: Compiler.php:112
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
Definition: Compiler.php:212
Represents a parent node.
Definition: Parent.php:19
__construct($name, $lineno, $tag=null)
Definition: Parent.php:20
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
Definition: Parent.php:25
Abstract class for all nodes that represents an expression.
Definition: Expression.php:19
getAttribute($name)
Definition: Node.php:152
$lineno
Definition: Node.php:22