ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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, true, 1);
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.
__construct(\ilGlobalTemplateInterface $il_template)
if($format !==null) $name
Definition: metadata.php:230