You are here

public function Twig_TokenParserBroker::setParser in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/TokenParserBroker.php \Twig_TokenParserBroker::setParser()

Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of.

Parameters

Twig_ParserInterface $parser A Twig_ParserInterface interface:

Overrides Twig_TokenParserBrokerInterface::setParser

File

vendor/twig/twig/lib/Twig/TokenParserBroker.php, line 132

Class

Twig_TokenParserBroker
Default implementation of a token parser broker.

Code

public function setParser(Twig_ParserInterface $parser) {
  $this->parser = $parser;
  foreach ($this->parsers as $tokenParser) {
    $tokenParser
      ->setParser($parser);
  }
  foreach ($this->brokers as $broker) {
    $broker
      ->setParser($parser);
  }
}