ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LoaderResourceRegistryWrapper.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
29{
31 private Loader $loader;
32
34 {
35 $this->resource_registry = $resource_registry;
36 $this->loader = $loader;
37 }
38
42 public function getRendererFor(Component $component, array $contexts): ComponentRenderer
43 {
44 $renderer = $this->loader->getRendererFor($component, $contexts);
45 $renderer->registerResources($this->resource_registry);
46 return $renderer;
47 }
48
52 public function getRendererFactoryFor(Component $component): RendererFactory
53 {
54 return $this->loader->getRendererFactoryFor($component);
55 }
56}
$renderer
Registers resources for retreived renderers at a ResourceRegistry.
getRendererFor(Component $component, array $contexts)
@inheritdocs
__construct(ResourceRegistry $resource_registry, Loader $loader)
A component is the most general form of an entity in the UI.
Definition: Component.php:28
An entity that renders components to a string output.
Loads renderers for components.
Definition: Loader.php:30
This is the interface that components should use if they want to load specific renderers.
Registry for resources required by rendered output like Javascript or CSS.