function Parser::setBlock
File
-
vendor/
twig/ twig/ src/ Parser.php, line 259
Class
- Parser
- @author Fabien Potencier <fabien@symfony.com>
Namespace
TwigCode
public function setBlock(string $name, BlockNode $value) : void {
if (isset($this->blocks[$name])) {
throw new SyntaxError(\sprintf("The block '%s' has already been defined line %d.", $name, $this->blocks[$name]
->getTemplateLine()), $this->getCurrentToken()
->getLine(), $this->blocks[$name]
->getSourceContext());
}
$this->blocks[$name] = new BodyNode([
$value,
], [], $value->getTemplateLine());
}