You are here

public function Twig_Parser::setMacro in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/lib/Twig/Parser.php \Twig_Parser::setMacro()

File

vendor/twig/twig/lib/Twig/Parser.php, line 250

Class

Twig_Parser
Default parser implementation.

Code

public function setMacro($name, Twig_Node_Macro $node) {
  if ($this
    ->isReservedMacroName($name)) {
    throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node
      ->getLine(), $this
      ->getFilename());
  }
  $this->macros[$name] = $node;
}