ILIAS  trunk Revision v11.0_alpha-1851-ga8564da6fed
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilResourceRegistry.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
30 {
31  public function __construct(
32  protected \ILIAS\UICore\GlobalTemplate $il_template,
33  ) {
34  }
35 
39  public function register(string $name): void
40  {
41  $path_parts = pathinfo($name);
42  switch ($path_parts["extension"]) {
43  case "js":
44  $this->il_template->addJavaScript($name, true, 1);
45  break;
46  case "css":
47  $this->il_template->addCss($name);
48  break;
49  case "less":
50  // Can be ignored, should be compiled into css
51  break;
52  default:
53  throw new InvalidArgumentException("Can't handle resource '$name'");
54  }
55  }
56 }
Registry for resources required by rendered output like Javascript or CSS.
Interface Observer Contains several chained tasks and infos about them.
__construct(protected \ILIAS\UICore\GlobalTemplate $il_template,)