SimpleTokenParser
extends Twig_Extensions_SimpleTokenParser
in package
Base class for all token parsers.
Table of Contents
- $grammar : mixed
- $parser : Parser
- $tag : mixed
- __construct() : mixed
- getGrammar() : string|Twig_Extensions_Grammar
- Gets the grammar as an object or as a string.
- getNode() : mixed
- Gets the nodes based on the parsed values.
- getTag() : mixed
- parse() : Twig_Node
- Parses a token and returns a node.
- parseGrammar() : mixed
- setParser() : mixed
- Sets the parser associated with this token parser.
- call() : mixed
- getAttribute() : mixed
- getNodeValues() : mixed
- markAsSafe() : mixed
- output() : mixed
Properties
$grammar
protected
mixed
$grammar
$parser
protected
Parser
$parser
$tag
protected
mixed
$tag
Methods
__construct()
public
__construct(mixed $tag, mixed $grammar) : mixed
Parameters
- $tag : mixed
- $grammar : mixed
Return values
mixed —getGrammar()
Gets the grammar as an object or as a string.
public
getGrammar() : string|Twig_Extensions_Grammar
Return values
string|Twig_Extensions_Grammar —A Twig_Extensions_Grammar instance or a string
getNode()
Gets the nodes based on the parsed values.
public
getNode(array<string|int, mixed> $values, mixed $line) : mixed
Parameters
- $values : array<string|int, mixed>
-
An array of values
- $line : mixed
-
The parser line
Return values
mixed —getTag()
public
getTag() : mixed
Return values
mixed —parse()
Parses a token and returns a node.
public
parse(Twig_Token $token) : Twig_Node
Parameters
- $token : Twig_Token
-
A Twig_Token instance
Return values
Twig_Node —A Twig_Node instance
parseGrammar()
public
static parseGrammar(mixed $str[, mixed $main = true ]) : mixed
Parameters
- $str : mixed
- $main : mixed = true
Return values
mixed —setParser()
Sets the parser associated with this token parser.
public
setParser(Parser $parser) : mixed
Parameters
- $parser : Parser
Return values
mixed —call()
protected
call(mixed $node, mixed $attribute[, mixed $arguments = array() ][, mixed $line = -1 ]) : mixed
Parameters
- $node : mixed
- $attribute : mixed
- $arguments : mixed = array()
- $line : mixed = -1
Return values
mixed —getAttribute()
protected
getAttribute(mixed $node, mixed $attribute[, mixed $arguments = array() ][, mixed $type = Twig_Node_Expression_GetAttr::TYPE_ANY ][, mixed $line = -1 ]) : mixed
Parameters
- $node : mixed
- $attribute : mixed
- $arguments : mixed = array()
- $type : mixed = Twig_Node_Expression_GetAttr::TYPE_ANY
- $line : mixed = -1
Return values
mixed —getNodeValues()
protected
getNodeValues(array<string|int, mixed> $values) : mixed
Parameters
- $values : array<string|int, mixed>
Return values
mixed —markAsSafe()
protected
markAsSafe(Twig_Node $node[, mixed $line = -1 ]) : mixed
Parameters
- $node : Twig_Node
- $line : mixed = -1
Return values
mixed —output()
protected
output(Twig_Node $node[, mixed $line = -1 ]) : mixed
Parameters
- $node : Twig_Node
- $line : mixed = -1