Class Twig_Node_SandboxedPrint

InheritanceTwig_Node_SandboxedPrint » Twig_Node_Print » Twig_Node
ImplementsTwig_NodeInterface, Twig_NodeOutputInterface

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.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$attributes Twig_Node
$lineno Twig_Node
$nodes Twig_Node
$tag Twig_Node

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Twig_Node_Print
__toString() Twig_Node
compile() Twig_Node_SandboxedPrint
count() Twig_Node
getAttribute() Gets an attribute value by name. Twig_Node
getFilename() Twig_Node
getIterator() Twig_Node
getLine() Twig_Node
getNode() Gets a node by name. Twig_Node
getNodeTag() Twig_Node
hasAttribute() Returns true if the attribute is defined. Twig_Node
hasNode() Returns true if the node with the given name exists. Twig_Node
removeAttribute() Removes an attribute by name. Twig_Node
removeNode() Removes a node by name. Twig_Node
setAttribute() Sets an attribute by name to a value. Twig_Node
setFilename() Twig_Node
setNode() Sets a node. Twig_Node
toXml() Twig_Node

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
removeNodeFilter() Removes node filters. Twig_Node_SandboxedPrint

Method Details

compile() public method

public void compile ( Twig_Compiler $compiler )
$compiler
removeNodeFilter() protected method

Removes node filters.

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

protected Twig_Node removeNodeFilter ( $node )
$node Twig_Node

A Node