ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 }
Registry for resources required by rendered output like Javascript or CSS.
if($format !==null) $name
Definition: metadata.php:146
special template class to simplify handling of ITX/PEAR