ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Renderer.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
5
7use ILIAS\UI\Renderer as RendererInterface;
9
11{
15 public function render(Component\Component $component, RendererInterface $default_renderer)
16 {
17 $this->checkComponent($component);
18
19 $tpl = $this->getTemplate("tpl.breadcrumbs.html", true, true);
20
21 foreach ($component->getItems() as $crumb) {
22 $tpl->setCurrentBlock("crumbs");
23 $tpl->setVariable("CRUMB", $default_renderer->render($crumb));
24 $tpl->parseCurrentBlock();
25 }
26 return $tpl->get();
27 }
28
32 protected function getComponentInterfaceName()
33 {
34 return array(
35 Component\Breadcrumbs\Breadcrumbs::class
36 );
37 }
38}
$tpl
Definition: ilias.php:10
An exception for terminatinating execution or to throw for unit testing.
getComponentInterfaceName()
Get the name of the component-interface this renderer is supposed to render.ATTENTION: Fully qualifie...
Definition: Renderer.php:32
render(Component\Component $component, RendererInterface $default_renderer)
Definition: Renderer.php:15
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
checkComponent(Component $component)
Check if a given component fits this renderer and throw \LogicError if that is not the case.
A component is the most general form of an entity in the UI.
Definition: Component.php:14
An entity that renders components to a string output.
Definition: Renderer.php:15