\Twig\NodeSandboxedPrintNode

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.

Summary

Methods
Properties
Constants
compile()
__construct()
__toString()
getTemplateLine()
getNodeTag()
hasAttribute()
getAttribute()
setAttribute()
removeAttribute()
hasNode()
getNode()
setNode()
removeNode()
count()
getIterator()
setTemplateName()
getTemplateName()
No public properties found
No constants found
No protected methods found
$nodes
$attributes
$lineno
$tag
N/A
removeNodeFilter()
$name
N/A

Properties

$nodes

$nodes : 

Type

$attributes

$attributes : 

Type

$lineno

$lineno : 

Type

$tag

$tag : 

Type

$name

$name : 

Type

Methods

compile()

compile(\Twig_Compiler  $compiler) 

Parameters

\Twig_Compiler $compiler

__construct()

__construct(array  $nodes = array(), array  $attributes = array(), 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

array $nodes

An array of named nodes

array $attributes

An array of attributes (should not be nodes)

integer $lineno

The line number

string $tag

The tag name associated with the Node

__toString()

__toString() 

getTemplateLine()

getTemplateLine() 

getNodeTag()

getNodeTag() 

hasAttribute()

hasAttribute(  $name) : boolean

Parameters

$name

Returns

boolean

getAttribute()

getAttribute(  $name) : mixed

Parameters

$name

Returns

mixed

setAttribute()

setAttribute(string  $name, mixed  $value) 

Parameters

string $name
mixed $value

removeAttribute()

removeAttribute(  $name) 

Parameters

$name

hasNode()

hasNode(  $name) : boolean

Parameters

$name

Returns

boolean

getNode()

getNode(  $name) : \Twig_Node

Parameters

$name

Returns

\Twig_Node

setNode()

setNode(  $name, self  $node) 

Parameters

$name
self $node

removeNode()

removeNode(  $name) 

Parameters

$name

count()

count() 

getIterator()

getIterator() 

setTemplateName()

setTemplateName(  $name) 

Parameters

$name

getTemplateName()

getTemplateName() 

removeNodeFilter()

removeNodeFilter(\Twig_Node  $node) : \Twig_Node

Removes node filters.

This is mostly needed when another visitor adds filters (like the escaper one).

Parameters

\Twig_Node $node

Returns

\Twig_Node