You are here

protected function Twig_Node_Module::compileLoadTemplate in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/lib/Twig/Node/Module.php \Twig_Node_Module::compileLoadTemplate()
1 call to Twig_Node_Module::compileLoadTemplate()
Twig_Node_Module::compileConstructor in vendor/twig/twig/lib/Twig/Node/Module.php

File

vendor/twig/twig/lib/Twig/Node/Module.php, line 387

Class

Twig_Node_Module
Represents a module node.

Code

protected function compileLoadTemplate(Twig_Compiler $compiler, $node, $var) {
  if ($node instanceof Twig_Node_Expression_Constant) {
    $compiler
      ->write(sprintf('%s = $this->loadTemplate(', $var))
      ->subcompile($node)
      ->raw(', ')
      ->repr($compiler
      ->getFilename())
      ->raw(', ')
      ->repr($node
      ->getLine())
      ->raw(");\n");
  }
  else {
    throw new LogicException('Trait templates can only be constant nodes');
  }
}