ILIAS  release_8 Revision v8.24
ilResourceRegistry.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
24use InvalidArgumentException;
25
31{
33
35 {
36 $this->il_template = $il_template;
37 }
38
42 public function register(string $name): void
43 {
44 $path_parts = pathinfo($name);
45 switch ($path_parts["extension"]) {
46 case "js":
47 $this->il_template->addJavaScript($name, true, 1);
48 break;
49 case "css":
50 $this->il_template->addCss($name);
51 break;
52 case "less":
53 // Can be ignored, should be compiled into css
54 break;
55 default:
56 throw new InvalidArgumentException("Can't handle resource '$name'");
57 }
58 }
59}
__construct(ilGlobalTemplateInterface $il_template)
Registry for resources required by rendered output like Javascript or CSS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...