Documentation

Twig_Extensions_SimpleTokenParser extends Twig_TokenParser
in package

Base class for all token parsers.

Tags
deprecated

since version 1.5

Table of Contents

$parser  : Parser
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
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.
getNodeValues()  : mixed
markAsSafe()  : mixed
output()  : mixed

Properties

Methods

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

getNode()

Gets the nodes based on the parsed values.

protected abstract getNode(array<string|int, mixed> $values, int $line) : mixed
Parameters
$values : array<string|int, mixed>

An array of values

$line : int

The parser line

Return values
mixed

getNodeValues()

protected getNodeValues(array<string|int, mixed> $values) : mixed
Parameters
$values : array<string|int, mixed>
Return values
mixed

Search results