public function Twig_Profiler_Node_EnterProfile::compile in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php \Twig_Profiler_Node_EnterProfile::compile()
Compiles the node to PHP.
Parameters
Twig_Compiler $compiler A Twig_Compiler instance:
Overrides Twig_Node::compile
File
- vendor/
twig/ twig/ lib/ Twig/ Profiler/ Node/ EnterProfile.php, line 27
Class
- Twig_Profiler_Node_EnterProfile
- Represents a profile enter node.
Code
public function compile(Twig_Compiler $compiler) {
$compiler
->write(sprintf('$%s = $this->env->getExtension(', $this
->getAttribute('var_name')))
->repr($this
->getAttribute('extension_name'))
->raw(");\n")
->write(sprintf('$%s->enter($%s = new Twig_Profiler_Profile($this->getTemplateName(), ', $this
->getAttribute('var_name'), $this
->getAttribute('var_name') . '_prof'))
->repr($this
->getAttribute('type'))
->raw(', ')
->repr($this
->getAttribute('name'))
->raw("));\n\n");
}