You are here

protected function Twig_Node_Include::addGetTemplate in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Node/Include.php \Twig_Node_Include::addGetTemplate()
1 call to Twig_Node_Include::addGetTemplate()
Twig_Node_Include::compile in vendor/Twig/Node/Include.php
Compiles the node to PHP.
1 method overrides Twig_Node_Include::addGetTemplate()
Twig_Node_Embed::addGetTemplate in vendor/Twig/Node/Embed.php

File

vendor/Twig/Node/Include.php, line 61

Class

Twig_Node_Include
Represents an include node.

Code

protected function addGetTemplate(Twig_Compiler $compiler) {
  $method = $this
    ->getNode('expr') instanceof Twig_Node_Expression_Constant ? 'loadTemplate' : 'resolveTemplate';
  $compiler
    ->write(sprintf('$this->env->%s(', $method))
    ->subcompile($this
    ->getNode('expr'))
    ->raw(')');
}