ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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  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 }
render(Component\Component $component, RendererInterface $default_renderer)
Definition: Renderer.php:16
Class Factory.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
Class ChatMainBarProvider .
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
registerResources(\ILIAS\UI\Implementation\Render\ResourceRegistry $registry)
Definition: Renderer.php:33