protected function Twig_Node_Include::addTemplateArguments

1 call to Twig_Node_Include::addTemplateArguments()
Twig_Node_Include::compile in drupal/core/vendor/twig/twig/lib/Twig/Node/Include.php
Compiles the node to PHP.

File

drupal/core/vendor/twig/twig/lib/Twig/Node/Include.php, line 79

Class

Twig_Node_Include
Represents an include node.

Code

protected function addTemplateArguments(Twig_Compiler $compiler) {
  if (false === $this
    ->getAttribute('only')) {
    if (null === $this
      ->getNode('variables')) {
      $compiler
        ->raw('$context');
    }
    else {
      $compiler
        ->raw('array_merge($context, ')
        ->subcompile($this
        ->getNode('variables'))
        ->raw(')');
    }
  }
  else {
    if (null === $this
      ->getNode('variables')) {
      $compiler
        ->raw('array()');
    }
    else {
      $compiler
        ->subcompile($this
        ->getNode('variables'));
    }
  }
}