function BlockReferenceExpression::compile
Overrides Node::compile
File
-
vendor/
twig/ twig/ src/ Node/ Expression/ BlockReferenceExpression.php, line 42
Class
- BlockReferenceExpression
- Represents a block call node.
Namespace
Twig\Node\ExpressionCode
public function compile(Compiler $compiler) : void {
if ($this->getAttribute('is_defined_test')) {
$this->compileTemplateCall($compiler, 'hasBlock');
}
else {
if ($this->getAttribute('output')) {
$compiler->addDebugInfo($this);
$compiler->write('yield from ');
$this->compileTemplateCall($compiler, 'yieldBlock')
->raw(";\n");
}
else {
$this->compileTemplateCall($compiler, 'renderBlock');
}
}
}