protected function Twig_Node_Include::addTemplateArguments in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/lib/Twig/Node/Include.php \Twig_Node_Include::addTemplateArguments()
1 call to Twig_Node_Include::addTemplateArguments()
- Twig_Node_Include::compile in vendor/
twig/ twig/ lib/ Twig/ Node/ Include.php - Compiles the node to PHP.
File
- vendor/
twig/ twig/ lib/ Twig/ Node/ Include.php, line 69
Class
- Twig_Node_Include
- Represents an include node.
Code
protected function addTemplateArguments(Twig_Compiler $compiler) {
if (null === $this
->getNode('variables')) {
$compiler
->raw(false === $this
->getAttribute('only') ? '$context' : 'array()');
}
elseif (false === $this
->getAttribute('only')) {
$compiler
->raw('array_merge($context, ')
->subcompile($this
->getNode('variables'))
->raw(')');
}
else {
$compiler
->subcompile($this
->getNode('variables'));
}
}