Twig API
Class

Twig_TokenParser_Sandbox

class Twig_TokenParser_Sandbox extends Twig_TokenParser

Marks a section of a template as untrusted code that must be evaluated in the sandbox mode.

<pre>
{% sandbox %}
{% include 'user.html' %}
{% endsandbox %}
</pre>

Methods

setParser(Twig_Parser $parser)

Sets the parser associated with this token parser

from Twig_TokenParser
Twig_NodeInterface parse(Twig_Token $token)

Parses a token and returns a node.

decideBlockEnd(Twig_Token $token)

string getTag()

Gets the tag name associated with this token parser.

Details

in Twig_TokenParser at line 30
public setParser(Twig_Parser $parser)

Sets the parser associated with this token parser

Parameters

Twig_Parser $parser A Twig_Parser instance

at line 32
public Twig_NodeInterface parse(Twig_Token $token)

Parses a token and returns a node.

Parameters

Twig_Token $token A Twig_Token instance

Return Value

Twig_NodeInterface A Twig_NodeInterface instance

at line 54
public decideBlockEnd(Twig_Token $token)

Parameters

Twig_Token $token

at line 64
public string getTag()

Gets the tag name associated with this token parser.

Return Value

string The tag name