You are here

protected function Twig_Node_Include::addTemplateArguments in Translation template extractor 7.3

Same name and namespace in other branches
  1. 6.3 vendor/Twig/Node/Include.php \Twig_Node_Include::addTemplateArguments()
1 call to Twig_Node_Include::addTemplateArguments()
Twig_Node_Include::compile in vendor/Twig/Node/Include.php
Compiles the node to PHP.

File

vendor/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'));
  }
}