ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_Profiler_Node_EnterProfile Class Reference

Represents a profile enter node. More...

+ Inheritance diagram for Twig_Profiler_Node_EnterProfile:
+ Collaboration diagram for Twig_Profiler_Node_EnterProfile:

Public Member Functions

 __construct ($extensionName, $type, $name, $varName)
 
 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 Attributes inherited from Twig_Node
 $nodes
 
 $attributes
 
 $lineno
 
 $tag
 

Detailed Description

Represents a profile enter node.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 17 of file EnterProfile.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Profiler_Node_EnterProfile::__construct (   $extensionName,
  $type,
  $name,
  $varName 
)

Definition at line 19 of file EnterProfile.php.

References Twig_Node\$name, and $type.

20  {
21  parent::__construct(array(), array('extension_name' => $extensionName, 'name' => $name, 'type' => $type, 'var_name' => $varName));
22  }
$type

Member Function Documentation

◆ compile()

Twig_Profiler_Node_EnterProfile::compile ( Twig_Compiler  $compiler)

Compiles the node to PHP.

Implements Twig_NodeInterface.

Definition at line 24 of file EnterProfile.php.

References Twig_Node\getAttribute(), and Twig_Compiler\write().

25  {
26  $compiler
27  ->write(sprintf('$%s = $this->env->getExtension(', $this->getAttribute('var_name')))
28  ->repr($this->getAttribute('extension_name'))
29  ->raw(");\n")
30  ->write(sprintf('$%s->enter($%s = new Twig_Profiler_Profile($this->getTemplateName(), ', $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof'))
31  ->repr($this->getAttribute('type'))
32  ->raw(', ')
33  ->repr($this->getAttribute('name'))
34  ->raw("));\n\n")
35  ;
36  }
getAttribute($name)
Definition: Node.php:152
write()
Writes a string to the compiled code by adding indentation.
Definition: Compiler.php:124
+ Here is the call graph for this function:

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