Twig_TokenParserBroker

Implements\Twig_TokenParserBrokerInterface

Default implementation of a token parser broker.

author

Arnaud Le Blanc arnaud.lb@gmail.com

deprecated

since 1.12 (to be removed in 2.0)

package

Default

Methods

__construct

__construct(array|\Traversable $parsers = array(),array|\Traversable $brokers = array(),boolean $triggerDeprecationError = true)

Arguments

$parsers

array|\Traversable

A \Traversable of Twig_TokenParserInterface instances

$brokers

array|\Traversable

A \Traversable of Twig_TokenParserBrokerInterface instances

$triggerDeprecationError

boolean

addTokenParser

addTokenParser(\Twig\TokenParser\TokenParserInterface $parser)

addTokenParserBroker

addTokenParserBroker(self $broker)

Arguments

$broker

self

Gets the Twig_ParserInterface.

getParser(): \Twig_ParserInterface|null

Response

\Twig_ParserInterface|null

A Twig_ParserInterface instance or null

getParsers

getParsers()

Gets a suitable TokenParser for a tag.

getTokenParser(string $tag): \Twig\TokenParser\TokenParserInterface|null

First looks in parsers, then in brokers.

Arguments

$tag

string

A tag name

Response

\Twig\TokenParser\TokenParserInterface|null

A Twig_TokenParserInterface or null if no suitable TokenParser was found

removeTokenParser

removeTokenParser(\Twig\TokenParser\TokenParserInterface $parser)

removeTokenParserBroker

removeTokenParserBroker(self $broker)

Arguments

$broker

self

Calls Twig\TokenParser\TokenParserInterface::setParser on all parsers the implementation knows of.

setParser(\Twig_ParserInterface $parser)

Arguments

Properties

parser

parser :

Type(s)

parsers

parsers :

Type(s)

brokers

brokers :

Type(s)