public function Twig_Template::displayParentBlock

Displays a parent block.

This method is for internal use only and should never be called directly.

Parameters

string $name The block name to display from the parent:

array $context The context:

array $blocks The current set of blocks:

1 call to Twig_Template::displayParentBlock()
Twig_Template::renderParentBlock in drupal/core/vendor/twig/twig/lib/Twig/Template.php
Renders a parent block.

File

drupal/core/vendor/twig/twig/lib/Twig/Template.php, line 103

Class

Twig_Template
Default base class for compiled templates.

Code

public function displayParentBlock($name, array $context, array $blocks = array()) {
  $name = (string) $name;
  if (isset($this->traits[$name])) {
    $this->traits[$name][0]
      ->displayBlock($name, $context, $blocks);
  }
  elseif (false !== ($parent = $this
    ->getParent($context))) {
    $parent
      ->displayBlock($name, $context, $blocks);
  }
  else {
    throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this
      ->getTemplateName());
  }
}