You are here

protected function Twig_Node_Module::compileTemplate in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Node/Module.php \Twig_Node_Module::compileTemplate()
1 call to Twig_Node_Module::compileTemplate()
Twig_Node_Module::compile in vendor/Twig/Node/Module.php
Compiles the node to PHP.

File

vendor/Twig/Node/Module.php, line 45

Class

Twig_Node_Module
Represents a module node.

Code

protected function compileTemplate(Twig_Compiler $compiler) {
  if (!$this
    ->getAttribute('index')) {
    $compiler
      ->write('<?php');
  }
  $this
    ->compileClassHeader($compiler);
  if (count($this
    ->getNode('blocks')) || count($this
    ->getNode('traits')) || null === $this
    ->getNode('parent') || $this
    ->getNode('parent') instanceof Twig_Node_Expression_Constant) {
    $this
      ->compileConstructor($compiler);
  }
  $this
    ->compileGetParent($compiler);
  $this
    ->compileDisplayHeader($compiler);
  $this
    ->compileDisplayBody($compiler);
  $this
    ->compileDisplayFooter($compiler);
  $compiler
    ->subcompile($this
    ->getNode('blocks'));
  $this
    ->compileMacros($compiler);
  $this
    ->compileGetTemplateName($compiler);
  $this
    ->compileIsTraitable($compiler);
  $this
    ->compileDebugInfo($compiler);
  $this
    ->compileClassFooter($compiler);
}