You are here

public function Twig_Template::displayParentBlock in Translation template extractor 7.3

Same name and namespace in other branches
  1. 6.3 vendor/Twig/Template.php \Twig_Template::displayParentBlock()

Displays a parent block.

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

@internal

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 vendor/Twig/Template.php
Renders a parent block.

File

vendor/Twig/Template.php, line 119

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, false);
  }
  elseif (false !== ($parent = $this
    ->getParent($context))) {
    $parent
      ->displayBlock($name, $context, $blocks, false);
  }
  else {
    throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this
      ->getTemplateName());
  }
}