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

Public Member Functions

 __construct ($name, Twig_NodeInterface $arguments, $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 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 Function.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Node_Expression_Function::__construct (   $name,
Twig_NodeInterface  $arguments,
  $lineno 
)

Definition at line 13 of file Function.php.

14 {
15 parent::__construct(array('arguments' => $arguments), array('name' => $name, 'is_defined_test' => false), $lineno);
16 }
$lineno
Definition: Node.php:22

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

Member Function Documentation

◆ compile()

Twig_Node_Expression_Function::compile ( Twig_Compiler  $compiler)

Compiles the node to PHP.

Reimplemented from Twig_Node.

Definition at line 18 of file Function.php.

19 {
20 $name = $this->getAttribute('name');
21 $function = $compiler->getEnvironment()->getFunction($name);
22
23 $this->setAttribute('name', $name);
24 $this->setAttribute('type', 'function');
25 $this->setAttribute('thing', $function);
26 $this->setAttribute('needs_environment', $function->needsEnvironment());
27 $this->setAttribute('needs_context', $function->needsContext());
28 $this->setAttribute('arguments', $function->getArguments());
30 $callable = $function->getCallable();
31 if ('constant' === $name && $this->getAttribute('is_defined_test')) {
32 $callable = 'twig_constant_is_defined';
33 }
34
35 $this->setAttribute('callable', $callable);
36 }
37 if ($function instanceof Twig_SimpleFunction) {
38 $this->setAttribute('is_variadic', $function->isVariadic());
39 }
40
41 $this->compileCallable($compiler);
42 }
$function
Definition: cas.php:28
getEnvironment()
Returns the environment instance related to this compiler.
Definition: Compiler.php:50
compileCallable(Twig_Compiler $compiler)
Definition: Call.php:15
getAttribute($name)
Definition: Node.php:152
setAttribute($name, $value)
Definition: Node.php:165
Represents a template function.
Represents a callable template function.

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

+ Here is the call graph for this function:

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