ILIAS  release_7 Revision v7.30-3-g800a261c036
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 if ($component->getNumber() === 0) {
22 $tpl->touchBlock("hidden_" . $component->getType());
23 }
24 $tpl->setCurrentBlock($component->getType());
25 $tpl->setVariable("NUMBER", $component->getNumber());
26 $tpl->parseCurrentBlock();
27 return $tpl->get();
28 }
29
33 public function registerResources(\ILIAS\UI\Implementation\Render\ResourceRegistry $registry)
34 {
35 parent::registerResources($registry);
36 $registry->register('./src/UI/templates/js/Counter/counter.js');
37 }
38
42 protected function getComponentInterfaceName()
43 {
44 return array(Component\Counter\Counter::class);
45 }
46}
An exception for terminatinating execution or to throw for unit testing.
registerResources(\ILIAS\UI\Implementation\Render\ResourceRegistry $registry)
Definition: Renderer.php:33
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
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.