public function Twig_Template::displayParentBlock in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/lib/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/ twig/ lib/ Twig/ Template.php - Renders a parent block.
File
- vendor/
twig/ twig/ lib/ 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());
}
}