ILIAS
release_8 Revision v8.19
|
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the component to be rendered. More...
Public Member Functions | |||||
__construct (Render\Loader $component_renderer_loader) | |||||
render ($component, ?Renderer $root=null) | |||||
Render given component.If an array of components is passed, this method returns a concatenated output of each rendered component, in the same order as given in the array
| |||||
renderAsync ($component, ?Renderer $root=null) | |||||
Same as render, except that this version also returns any javascript code bound to the on load event, wrapped in a script tag.All javascript code stored for rendering will be removed after this output so it will not be rendered twice if render async is called multiple times.
| |||||
withAdditionalContext (Component $context) | |||||
Get a new renderer with an additional context.A context makes it possible to use another renderer for (some) components when they are renderer as subcomponents of a certain components. The use case that spawned this functionality is the observation, that e.g. items representing repository objects are renderer in different lists, where the individual items look different every time but are morally the same item. Another use case could be a special rendering of input fields in filters over tables.If a component wants to render itself differently in different contexts, it must implement a RendererFactory. The class contains directions how to do that. More... | |||||
Protected Member Functions | |
getRendererFor (Component $component) | |
Get a renderer for a certain Component class. More... | |
getJSCodeForAsyncRenderingFor (Component $component) | |
Get JS-Code for asynchronous rendering of component. More... | |
getContexts () | |
Get the contexts that are added via withAdditionalContext where most recently added contexts come last. More... | |
Private Attributes | |
Render Loader | $component_renderer_loader |
array | $contexts = [] |
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the component to be rendered.
Definition at line 32 of file DefaultRenderer.php.
ILIAS\UI\Implementation\DefaultRenderer::__construct | ( | Render\Loader | $component_renderer_loader | ) |
Definition at line 41 of file DefaultRenderer.php.
References ILIAS\UI\Implementation\DefaultRenderer\$component_renderer_loader.
|
protected |
Get the contexts that are added via withAdditionalContext where most recently added contexts come last.
Definition at line 128 of file DefaultRenderer.php.
References ILIAS\UI\Implementation\DefaultRenderer\$contexts.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\getRendererFor().
|
protected |
Get JS-Code for asynchronous rendering of component.
Component | $component |
Definition at line 104 of file DefaultRenderer.php.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\renderAsync().
|
protected |
Get a renderer for a certain Component class.
Either initializes a new renderer or uses a cached one initialized before.
LogicException | if no renderer could be found for component. |
Definition at line 93 of file DefaultRenderer.php.
References ILIAS\UI\Implementation\DefaultRenderer\getContexts().
Referenced by ILIAS\UI\Implementation\DefaultRenderer\render().
ILIAS\UI\Implementation\DefaultRenderer::render | ( | $component, | |
?Renderer | $root = null |
||
) |
Render given component.If an array of components is passed, this method returns a concatenated output of each rendered component, in the same order as given in the array
Component|Component[] | $component |
?Renderer | $root of renderers in the chain to be used for rendering sub components. |
Implements ILIAS\UI\Renderer.
Definition at line 49 of file DefaultRenderer.php.
References $out, and ILIAS\UI\Implementation\DefaultRenderer\getRendererFor().
Referenced by ILIAS\UI\Implementation\DefaultRenderer\renderAsync().
ILIAS\UI\Implementation\DefaultRenderer::renderAsync | ( | $component, | |
?Renderer | $root = null |
||
) |
Same as render, except that this version also returns any javascript code bound to the on load event, wrapped in a script tag.All javascript code stored for rendering will be removed after this output so it will not be rendered twice if render async is called multiple times.
Component|Component[] | $component |
?Renderer | $root of renderers in the chain to be used for rendering sub components. |
Implements ILIAS\UI\Renderer.
Definition at line 69 of file DefaultRenderer.php.
References $out, ILIAS\UI\Implementation\DefaultRenderer\getJSCodeForAsyncRenderingFor(), and ILIAS\UI\Implementation\DefaultRenderer\render().
ILIAS\UI\Implementation\DefaultRenderer::withAdditionalContext | ( | Component | $context | ) |
Get a new renderer with an additional context.A context makes it possible to use another renderer for (some) components when they are renderer as subcomponents of a certain components. The use case that spawned this functionality is the observation, that e.g. items representing repository objects are renderer in different lists, where the individual items look different every time but are morally the same item. Another use case could be a special rendering of input fields in filters over tables.If a component wants to render itself differently in different contexts, it must implement a RendererFactory. The class contains directions how to do that.
Implements ILIAS\UI\Renderer.
Definition at line 115 of file DefaultRenderer.php.
References $context.
|
private |
Definition at line 34 of file DefaultRenderer.php.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\__construct().
|
private |
Definition at line 39 of file DefaultRenderer.php.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\getContexts().