function IncludeNode::addTemplateArguments
1 call to IncludeNode::addTemplateArguments()
- IncludeNode::compile in vendor/
twig/ twig/ src/ Node/ IncludeNode.php
File
-
vendor/
twig/ twig/ src/ Node/ IncludeNode.php, line 94
Class
- IncludeNode
- Represents an include node.
Namespace
Twig\NodeCode
protected function addTemplateArguments(Compiler $compiler) {
if (!$this->hasNode('variables')) {
$compiler->raw(false === $this->getAttribute('only') ? '$context' : '[]');
}
elseif (false === $this->getAttribute('only')) {
$compiler->raw('CoreExtension::merge($context, ')
->subcompile($this->getNode('variables'))
->raw(')');
}
else {
$compiler->raw('CoreExtension::toArray(');
$compiler->subcompile($this->getNode('variables'));
$compiler->raw(')');
}
}