ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
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 }
render(Component\Component $component, RendererInterface $default_renderer)
Definition: Renderer.php:16
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
$tpl
Definition: ilias.php:10
Create styles array
The data for the language used.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.