ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ILIAS\UI\Renderer Interface Reference

An entity that renders components to a string output. More...

+ Inheritance diagram for ILIAS\UI\Renderer:
+ Collaboration diagram for ILIAS\UI\Renderer:

Public Member Functions

 render ($component)
 Render given component. More...
 
 renderAsync ($component)
 Same as render, except that this version also returns any javascript code bound to the on load event, wrapped in a script tag. More...
 
 withAdditionalContext (Component $context)
 Get a new renderer with an additional context. More...
 

Detailed Description

An entity that renders components to a string output.

Author
Richard Klees richa.nosp@m.rd.k.nosp@m.lees@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de

Definition at line 14 of file Renderer.php.

Member Function Documentation

◆ render()

ILIAS\UI\Renderer::render (   $component)

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

Parameters
Component|Component[]$component
Returns
string

Implemented in NullDefaultRenderer, and ILIAS\UI\Implementation\DefaultRenderer.

◆ renderAsync()

ILIAS\UI\Renderer::renderAsync (   $component)

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.

Parameters
Component|Component[]$component
Returns
string

Implemented in NullDefaultRenderer, and ILIAS\UI\Implementation\DefaultRenderer.

◆ withAdditionalContext()

ILIAS\UI\Renderer::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.

Parameters
Component$context
Returns
Renderer

Implemented in ILIAS\UI\Implementation\DefaultRenderer.


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