ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DefaultRendererFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\Data\Factory as DataFactory;
24use ILIAS\Refinery\Factory as Refinery;
30
32{
33 public function __construct(
34 protected FactoryInternal $ui_factory,
35 protected TemplateFactory $tpl_factory,
36 protected Language $lng,
37 protected JavaScriptBinding $js_binding,
38 protected ImagePathResolver $image_path_resolver,
39 protected DataFactory $data_factory,
40 protected HelpTextRetriever $help_text_retriever,
41 protected UploadLimitResolver $upload_limit_resolver,
42 ) {
43 }
44
48 public function getRendererInContext(Component $component, array $contexts): ComponentRenderer
49 {
50 $name = $this->getRendererNameFor($component);
51 return new $name(
52 $this->ui_factory,
53 $this->tpl_factory,
54 $this->lng,
55 $this->js_binding,
56 $this->image_path_resolver,
57 $this->data_factory,
58 $this->help_text_retriever,
59 $this->upload_limit_resolver,
60 );
61 }
62
66 protected function getRendererNameFor(Component $component): string
67 {
68 $class = get_class($component);
69 $parts = explode("\\", $class);
70 $parts[count($parts) - 1] = "Renderer";
71 return implode("\\", $parts);
72 }
73}
Builds data types.
Definition: Factory.php:36
__construct(protected FactoryInternal $ui_factory, protected TemplateFactory $tpl_factory, protected Language $lng, protected JavaScriptBinding $js_binding, protected ImagePathResolver $image_path_resolver, protected DataFactory $data_factory, protected HelpTextRetriever $help_text_retriever, protected UploadLimitResolver $upload_limit_resolver,)
getRendererNameFor(Component $component)
Get the name for the renderer of Component class.
getRendererInContext(Component $component, array $contexts)
@inheritdocs
A component is the most general form of an entity in the UI.
Definition: Component.php:28
This describes a facility that the UI framework can use to retrieve some help text.
An entity that renders components to a string output.
Some Components need to resolve pathes to image-files.
Provides methods to interface with javascript.
This is the interface that components should use if they want to load specific renderers.
Interface for a factory that provides templates.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
global $lng
Definition: privfeed.php:31