You are here

protected function Twig_Node_Module::compileDisplay 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::compileDisplay()
1 call to Twig_Node_Module::compileDisplay()
Twig_Node_Module::compileTemplate in vendor/twig/twig/lib/Twig/Node/Module.php

File

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

Class

Twig_Node_Module
Represents a module node.

Code

protected function compileDisplay(Twig_Compiler $compiler) {
  $compiler
    ->write("protected function doDisplay(array \$context, array \$blocks = array())\n", "{\n")
    ->indent()
    ->subcompile($this
    ->getNode('display_start'))
    ->subcompile($this
    ->getNode('body'));
  if (null !== ($parent = $this
    ->getNode('parent'))) {
    $compiler
      ->addDebugInfo($parent);
    if ($parent instanceof Twig_Node_Expression_Constant) {
      $compiler
        ->write('$this->parent');
    }
    else {
      $compiler
        ->write('$this->getParent($context)');
    }
    $compiler
      ->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n");
  }
  $compiler
    ->subcompile($this
    ->getNode('display_end'))
    ->outdent()
    ->write("}\n\n");
}