ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilResourceRegistry.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
15 protected $il_template;
16
18 $this->il_template = $il_template;
19 }
20
24 public function register($name) {
25 $path_parts = pathinfo($name);
26 switch ($path_parts["extension"]) {
27 case "js":
28 $this->il_template->addJavaScript($name);
29 break;
30 case "css":
31 $this->il_template->addCss($name);
32 break;
33 case "less":
34 // Can be ignored, should be compiled into css
35 break;
36 default:
37 throw new \InvalidArgumentException("Can't handle resource '$name'");
38 }
39 }
40}
An exception for terminatinating execution or to throw for unit testing.
special template class to simplify handling of ITX/PEAR
Registry for resources required by rendered output like Javascript or CSS.