ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
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  $tpl->setVariable("ARIA_LABEL", $this->txt('breadcrumbs_aria_label'));
22 
23  foreach ($component->getItems() as $crumb) {
24  $tpl->setCurrentBlock("crumbs");
25  $tpl->setVariable("CRUMB", $default_renderer->render($crumb));
26  $tpl->parseCurrentBlock();
27  }
28  return $tpl->get();
29  }
30 
34  protected function getComponentInterfaceName()
35  {
36  return array(
37  Component\Breadcrumbs\Breadcrumbs::class
38  );
39  }
40 }
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
render(Component\Component $component, RendererInterface $default_renderer)
Definition: Renderer.php:15
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.