ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\UI\Implementation\Render\FSLoader Class Reference

Loads renderers for components from the file system. More...

+ Inheritance diagram for ILIAS\UI\Implementation\Render\FSLoader:
+ Collaboration diagram for ILIAS\UI\Implementation\Render\FSLoader:

Public Member Functions

 __construct (private RendererFactory $default_renderer_factory, private RendererFactory $glyph_renderer_factory, private RendererFactory $field_renderer_factory, private RendererFactory $message_box_renderer_factory, private RendererFactory $form_renderer_factory, private RendererFactory $menu_renderer_factory,)
 
 getRendererFor (Component $component, array $contexts)
 @inheritdocs More...
 
 getRendererFactoryFor (Component $component)
 @inheritdocs More...
 
 getRendererFor (Component $component, array $contexts)
 Get a renderer for a certain Component class. More...
 
 getRendererFactoryFor (Component $component)
 Get a factory for a renderer for a certain component class. More...
 

Detailed Description

Loads renderers for components from the file system.

To introduce a component that may react on the context of the rendering, you need to:

  • create a new implementation of RendererFactory in the implementation folder of that component
  • introduce it as a dependency of this loader (and load at ilInitialisation::initUIFramework)
  • make a special case for the components the new factory may create renderers for in FSLoader::getRendererFactoryFor

Definition at line 42 of file FSLoader.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\UI\Implementation\Render\FSLoader::__construct ( private RendererFactory  $default_renderer_factory,
private RendererFactory  $glyph_renderer_factory,
private RendererFactory  $field_renderer_factory,
private RendererFactory  $message_box_renderer_factory,
private RendererFactory  $form_renderer_factory,
private RendererFactory  $menu_renderer_factory 
)

Definition at line 46 of file FSLoader.php.

53 {
54 }

Member Function Documentation

◆ getRendererFactoryFor()

ILIAS\UI\Implementation\Render\FSLoader::getRendererFactoryFor ( Component  $component)

@inheritdocs

Implements ILIAS\UI\Implementation\Render\Loader.

Definition at line 69 of file FSLoader.php.

70 {
71 if ($component instanceof Glyph) {
72 return $this->glyph_renderer_factory;
73 }
74 if ($component instanceof FormInput) {
75 return $this->field_renderer_factory;
76 }
77 if ($component instanceof MessageBox) {
78 return $this->message_box_renderer_factory;
79 }
80 if ($component instanceof Form) {
81 return $this->form_renderer_factory;
82 }
83 if ($component instanceof Menu) {
84 return $this->menu_renderer_factory;
85 }
86
87 return $this->default_renderer_factory;
88 }
This is the interface that components should use if they want to load specific renderers.

Referenced by ILIAS\UI\Implementation\Render\FSLoader\getRendererFor().

+ Here is the caller graph for this function:

◆ getRendererFor()

ILIAS\UI\Implementation\Render\FSLoader::getRendererFor ( Component  $component,
array  $contexts 
)

@inheritdocs

Implements ILIAS\UI\Implementation\Render\Loader.

Definition at line 59 of file FSLoader.php.

59 : ComponentRenderer
60 {
61 $context_names = $this->getContextNames($contexts);
62 $factory = $this->getRendererFactoryFor($component);
63 return $factory->getRendererInContext($component, $context_names);
64 }
getRendererFactoryFor(Component $component)
@inheritdocs
Definition: FSLoader.php:69

References ILIAS\UI\Implementation\Render\FSLoader\getRendererFactoryFor().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: