Class Twig_TokenParserBroker

InheritanceTwig_TokenParserBroker
ImplementsTwig_TokenParserBrokerInterface
Deprecated since version since 1.12 (to be removed in 2.0)

Default implementation of a token parser broker.

Property Details

$brokers protected property
protected $brokers = []
$parser protected property
protected $parser null
$parsers protected property
protected $parsers = []

Method Details

__construct() public method

Constructor.

public void __construct ( $parsers = [], $brokers = [], $triggerDeprecationError true )
$parsers array|Traversable

A Traversable of Twig_TokenParserInterface instances

$brokers array|Traversable

A Traversable of Twig_TokenParserBrokerInterface instances

$triggerDeprecationError bool
addTokenParser() public method

Adds a TokenParser.

public void addTokenParser ( Twig_TokenParserInterface $parser )
$parser Twig_TokenParserInterface

A Twig_TokenParserInterface instance

addTokenParserBroker() public method

Adds a TokenParserBroker.

public void addTokenParserBroker ( Twig_TokenParserBroker $broker )
$broker Twig_TokenParserBroker

A Twig_TokenParserBroker instance

getParser() public method

public void getParser ( )
getParsers() public method

public void getParsers ( )
getTokenParser() public method

Gets a suitable TokenParser for a tag.

First looks in parsers, then in brokers.

public null|Twig_TokenParserInterface getTokenParser ( $tag )
$tag string

A tag name

return null|Twig_TokenParserInterface

A Twig_TokenParserInterface or null if no suitable TokenParser was found

removeTokenParser() public method

Removes a TokenParser.

public void removeTokenParser ( Twig_TokenParserInterface $parser )
$parser Twig_TokenParserInterface

A Twig_TokenParserInterface instance

removeTokenParserBroker() public method

Removes a TokenParserBroker.

public void removeTokenParserBroker ( Twig_TokenParserBroker $broker )
$broker Twig_TokenParserBroker

A Twig_TokenParserBroker instance

setParser() public method

public void setParser ( Twig_ParserInterface $parser )
$parser