ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
12{
16 protected $il_template;
17
19 {
20 $this->il_template = $il_template;
21 }
22
26 public function register($name)
27 {
28 $path_parts = pathinfo($name);
29 switch ($path_parts["extension"]) {
30 case "js":
31 $this->il_template->addJavaScript($name);
32 break;
33 case "css":
34 $this->il_template->addCss($name);
35 break;
36 case "less":
37 // Can be ignored, should be compiled into css
38 break;
39 default:
40 throw new \InvalidArgumentException("Can't handle resource '$name'");
41 }
42 }
43}
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.