ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Twig_Node_SetTemp Class Reference
+ Inheritance diagram for Twig_Node_SetTemp:
+ Collaboration diagram for Twig_Node_SetTemp:

Public Member Functions

 __construct ($name, $lineno)
 
 compile (Twig_Compiler $compiler)
 Compiles the node to PHP. More...
 
- Public Member Functions inherited from Twig_Node
 __construct (array $nodes=array(), array $attributes=array(), $lineno=0, $tag=null)
 Constructor. More...
 
 __toString ()
 
 toXml ($asDom=false)
 
 compile (Twig_Compiler $compiler)
 Compiles the node to PHP. More...
 
 getTemplateLine ()
 
 getLine ()
 
 getNodeTag ()
 
 hasAttribute ($name)
 
 getAttribute ($name)
 
 setAttribute ($name, $value)
 
 removeAttribute ($name)
 
 hasNode ($name)
 
 getNode ($name)
 
 setNode ($name, $node=null)
 
 removeNode ($name)
 
 count ()
 
 getIterator ()
 
 setTemplateName ($name)
 
 getTemplateName ()
 
 setFilename ($name)
 
 getFilename ()
 
 compile (Twig_Compiler $compiler)
 Compiles the node to PHP. More...
 
 getLine ()
 
 getNodeTag ()
 

Additional Inherited Members

- Protected Attributes inherited from Twig_Node
 $nodes
 
 $attributes
 
 $lineno
 
 $tag
 

Detailed Description

Definition at line 15 of file SetTemp.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Node_SetTemp::__construct (   $name,
  $lineno 
)

Definition at line 17 of file SetTemp.php.

18 {
19 parent::__construct(array(), array('name' => $name), $lineno);
20 }
$lineno
Definition: Node.php:22

References Twig_Node\$lineno, and Twig_Node\$name.

Member Function Documentation

◆ compile()

Twig_Node_SetTemp::compile ( Twig_Compiler  $compiler)

Compiles the node to PHP.

Reimplemented from Twig_Node.

Definition at line 22 of file SetTemp.php.

23 {
24 $name = $this->getAttribute('name');
25 $compiler
26 ->addDebugInfo($this)
27 ->write('if (isset($context[')
28 ->string($name)
29 ->raw('])) { $_')
30 ->raw($name)
31 ->raw('_ = $context[')
32 ->repr($name)
33 ->raw(']; } else { $_')
34 ->raw($name)
35 ->raw("_ = null; }\n")
36 ;
37 }
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
Definition: Compiler.php:212
getAttribute($name)
Definition: Node.php:152

References Twig_Node\$name, Twig_Compiler\addDebugInfo(), and Twig_Node\getAttribute().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: