function EmbedNode::addGetTemplate
Overrides IncludeNode::addGetTemplate
File
-
vendor/
twig/ twig/ src/ Node/ EmbedNode.php, line 36
Class
- EmbedNode
- Represents an embed node.
Namespace
Twig\NodeCode
protected function addGetTemplate(Compiler $compiler, string $template = '') : void {
$compiler->raw('$this->loadTemplate(')
->string($this->getAttribute('name'))
->raw(', ')
->repr($this->getTemplateName())
->raw(', ')
->repr($this->getTemplateLine())
->raw(', ')
->string($this->getAttribute('index'))
->raw(')');
if ($this->getAttribute('ignore_missing')) {
$compiler->raw(";\n")
->write(\sprintf("\$%s->getParent(\$context);\n", $template));
}
}