ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Renderer.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2016 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
6
8use ILIAS\UI\Renderer as RendererInterface;
10
12{
16 public function render(Component\Component $component, RendererInterface $default_renderer)
17 {
18 $this->checkComponent($component);
19
20 $tpl = $this->getTemplate("tpl.counter.html", true, true);
21 $tpl->setCurrentBlock($component->getType());
22 $tpl->setVariable("NUMBER", $component->getNumber());
23 $tpl->parseCurrentBlock();
24
25 return $tpl->get();
26 }
27
31 protected function getComponentInterfaceName()
32 {
33 return array(Component\Counter\Counter::class);
34 }
35}
$tpl
Definition: ilias.php:10
An exception for terminatinating execution or to throw for unit testing.
render(Component\Component $component, RendererInterface $default_renderer)
@inheritdocs
Definition: Renderer.php:16
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