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

Public Member Functions

 __construct (Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments=null, $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 ()
 

Additional Inherited Members

- Protected Member Functions inherited from Twig_Node_Expression_Call
 compileCallable (Twig_Compiler $compiler)
 
 compileArguments (Twig_Compiler $compiler)
 
 getArguments ($callable, $arguments)
 
 normalizeName ($name)
 
- Protected Attributes inherited from Twig_Node
 $nodes
 
 $attributes
 
 $lineno
 
 $tag
 

Detailed Description

Definition at line 11 of file Test.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Node_Expression_Test::__construct ( Twig_NodeInterface  $node,
  $name,
Twig_NodeInterface  $arguments = null,
  $lineno 
)

Definition at line 13 of file Test.php.

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

14  {
15  $nodes = array('node' => $node);
16  if (null !== $arguments) {
17  $nodes['arguments'] = $arguments;
18  }
19 
20  parent::__construct($nodes, array('name' => $name), $lineno);
21  }
$lineno
Definition: Node.php:22
$nodes
Definition: Node.php:20
Create styles array
The data for the language used.

Member Function Documentation

◆ compile()

Twig_Node_Expression_Test::compile ( Twig_Compiler  $compiler)

Compiles the node to PHP.

Implements Twig_NodeInterface.

Definition at line 23 of file Test.php.

References Twig_Node\$name, $test, Twig_Node_Expression_Call\compileCallable(), Twig_Node\getAttribute(), Twig_Compiler\getEnvironment(), and Twig_Node\setAttribute().

24  {
25  $name = $this->getAttribute('name');
26  $test = $compiler->getEnvironment()->getTest($name);
27 
28  $this->setAttribute('name', $name);
29  $this->setAttribute('type', 'test');
30  $this->setAttribute('thing', $test);
31  if ($test instanceof Twig_TestCallableInterface || $test instanceof Twig_SimpleTest) {
32  $this->setAttribute('callable', $test->getCallable());
33  }
34  if ($test instanceof Twig_SimpleTest) {
35  $this->setAttribute('is_variadic', $test->isVariadic());
36  }
37 
38  $this->compileCallable($compiler);
39  }
Represents a callable template test.
getAttribute($name)
Definition: Node.php:152
getEnvironment()
Returns the environment instance related to this compiler.
Definition: Compiler.php:50
setAttribute($name, $value)
Definition: Node.php:165
Represents a template test.
Definition: SimpleTest.php:19
compileCallable(Twig_Compiler $compiler)
Definition: Call.php:15
$test
Definition: Utf8Test.php:84
+ Here is the call graph for this function:

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