ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_Node_Expression_MethodCall Class Reference
+ Inheritance diagram for Twig_Node_Expression_MethodCall:
+ Collaboration diagram for Twig_Node_Expression_MethodCall:

Public Member Functions

 __construct (Twig_Node_Expression $node, $method, Twig_Node_Expression_Array $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 Attributes inherited from Twig_Node
 $nodes
 
 $attributes
 
 $lineno
 
 $tag
 

Detailed Description

Definition at line 11 of file MethodCall.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Node_Expression_MethodCall::__construct ( Twig_Node_Expression  $node,
  $method,
Twig_Node_Expression_Array  $arguments,
  $lineno 
)

Definition at line 13 of file MethodCall.php.

14 {
15 parent::__construct(array('node' => $node, 'arguments' => $arguments), array('method' => $method, 'safe' => false), $lineno);
16
17 if ($node instanceof Twig_Node_Expression_Name) {
18 $node->setAttribute('always_defined', true);
19 }
20 }
$lineno
Definition: Node.php:22
setAttribute($name, $value)
Definition: Node.php:165

References Twig_Node\$lineno, and Twig_Node\setAttribute().

+ Here is the call graph for this function:

Member Function Documentation

◆ compile()

Twig_Node_Expression_MethodCall::compile ( Twig_Compiler  $compiler)

Compiles the node to PHP.

Reimplemented from Twig_Node.

Definition at line 22 of file MethodCall.php.

23 {
24 $compiler
25 ->subcompile($this->getNode('node'))
26 ->raw('->')
27 ->raw($this->getAttribute('method'))
28 ->raw('(')
29 ;
30 $first = true;
31 foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) {
32 if (!$first) {
33 $compiler->raw(', ');
34 }
35 $first = false;
36
37 $compiler->subcompile($pair['value']);
38 }
39 $compiler->raw(')');
40 }
raw($string)
Adds a raw string to the compiled code.
Definition: Compiler.php:112
subcompile(Twig_NodeInterface $node, $raw=true)
Definition: Compiler.php:94
getAttribute($name)
Definition: Node.php:152
getNode($name)
Definition: Node.php:186

References Twig_Node\getAttribute(), Twig_Node\getNode(), Twig_Compiler\raw(), and Twig_Compiler\subcompile().

+ Here is the call graph for this function:

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