Twig API
Class

Twig_Node_SandboxedPrint

class Twig_Node_SandboxedPrint extends Twig_Node_Print

Twig_Node_SandboxedPrint adds a check for the __toString() method when the variable is an object and the sandbox is activated.

When there is a simple Print statement, like {{ article }},
and if the sandbox is enabled, we need to check that the __toString()
method is allowed if 'article' is an object.

Methods

__construct(Twig_Node_Expression $expr, integer $lineno, string $tag = null)

Constructor.

compile(Twig_Compiler $compiler)

Compiles the node to PHP.

Details

at line 24
public __construct(Twig_Node_Expression $expr, integer $lineno, string $tag = null)

Constructor.

The nodes are automatically made available as properties ($this->node).
The attributes are automatically made available as array items ($this['name']).

Parameters

Twig_Node_Expression $expr
integer $lineno The line number
string $tag The tag name associated with the Node

at line 34
public compile(Twig_Compiler $compiler)

Compiles the node to PHP.

Parameters

Twig_Compiler $compiler A Twig_Compiler instance