ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
DefaultRendererFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
28 use ilLanguage;
30 
32 {
33  public function __construct(
34  protected RootFactory $ui_factory,
35  protected TemplateFactory $tpl_factory,
36  protected ilLanguage $lng,
37  protected JavaScriptBinding $js_binding,
38  protected Refinery $refinery,
39  protected ImagePathResolver $image_path_resolver,
40  protected DataFactory $data_factory,
41  protected HelpTextRetriever $help_text_retriever,
42  protected UploadLimitResolver $upload_limit_resolver,
43  ) {
44  }
45 
49  public function getRendererInContext(Component $component, array $contexts): ComponentRenderer
50  {
51  $name = $this->getRendererNameFor($component);
52  return new $name(
53  $this->ui_factory,
54  $this->tpl_factory,
55  $this->lng,
56  $this->js_binding,
57  $this->refinery,
58  $this->image_path_resolver,
59  $this->data_factory,
60  $this->help_text_retriever,
61  $this->upload_limit_resolver,
62  );
63  }
64 
68  protected function getRendererNameFor(Component $component): string
69  {
70  $class = get_class($component);
71  $parts = explode("\\", $class);
72  $parts[count($parts) - 1] = "Renderer";
73  return implode("\\", $parts);
74  }
75 
79  public function getJSBinding(): JavaScriptBinding
80  {
81  return $this->js_binding;
82  }
83 }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Some Components need to resolve pathes to image-files.
This describes a facility that the UI framework can use to retrieve some help text.
getRendererNameFor(Component $component)
Get the name for the renderer of Component class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$lng
Provides methods to interface with javascript.
This is the interface that components should use if they want to load specific renderers.
__construct(protected RootFactory $ui_factory, protected TemplateFactory $tpl_factory, protected ilLanguage $lng, protected JavaScriptBinding $js_binding, protected Refinery $refinery, protected ImagePathResolver $image_path_resolver, protected DataFactory $data_factory, protected HelpTextRetriever $help_text_retriever, protected UploadLimitResolver $upload_limit_resolver,)
getRendererInContext(Component $component, array $contexts)
Interface for a factory that provides templates.
Refinery Factory $refinery