protected function Twig_Node_Module::compileTemplate

1 call to Twig_Node_Module::compileTemplate()
Twig_Node_Module::compile in drupal/core/vendor/twig/twig/lib/Twig/Node/Module.php
Compiles the node to PHP.

File

drupal/core/vendor/twig/twig/lib/Twig/Node/Module.php, line 46

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);
}