ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilResourceRegistry.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use InvalidArgumentException;
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}
__construct(protected \ILIAS\UICore\GlobalTemplate $il_template,)
Registry for resources required by rendered output like Javascript or CSS.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.