|
ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
|
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the component to be rendered. More...
Inheritance diagram for ILIAS\UI\Implementation\DefaultRenderer:
Collaboration diagram for ILIAS\UI\Implementation\DefaultRenderer:Public Member Functions | |||||
| __construct (private Render\Loader $component_renderer_loader, private JavaScriptBinding $java_script_binding,) | |||||
| 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.
| |||||
Protected Member Functions | |
| getRendererFor (Component $component) | |
| Get a renderer for a certain Component class. More... | |
| getContexts () | |
| Returns the current context stack, where most recently added components are last. More... | |
| pushContext (Component $component) | |
| Adds a component to the current context stack. More... | |
| popContext () | |
| Removes the most recently added component from the current context stack. More... | |
Private Attributes | |
| 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 33 of file DefaultRenderer.php.
| ILIAS\UI\Implementation\DefaultRenderer::__construct | ( | private Render\Loader | $component_renderer_loader, |
| private JavaScriptBinding | $java_script_binding | ||
| ) |
Definition at line 40 of file DefaultRenderer.php.
|
protected |
Returns the current context stack, where most recently added components are last.
E.g. ["FirstComponent", "SecondComponent", "ThirdComponent", ...];
Definition at line 109 of file DefaultRenderer.php.
References ILIAS\UI\Implementation\DefaultRenderer\$contexts.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\getRendererFor().
Here is the caller graph for this function:
|
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 98 of file DefaultRenderer.php.
References ILIAS\UI\Implementation\DefaultRenderer\getContexts().
Referenced by ILIAS\UI\Implementation\DefaultRenderer\render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Removes the most recently added component from the current context stack.
This mainly serves for testability.
Definition at line 126 of file DefaultRenderer.php.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\render().
Here is the caller graph for this function:
|
protected |
Adds a component to the current context stack.
This mainly serves for testability.
Definition at line 117 of file DefaultRenderer.php.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\render().
Here is the caller graph for this function:| 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, $renderer, ILIAS\UI\Implementation\DefaultRenderer\getRendererFor(), ILIAS\UI\Implementation\DefaultRenderer\popContext(), and ILIAS\UI\Implementation\DefaultRenderer\pushContext().
Referenced by ILIAS\UI\Implementation\DefaultRenderer\renderAsync(), and DefaultRendererTest\testRenderingChainAndContextStack().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 75 of file DefaultRenderer.php.
References $out, and ILIAS\UI\Implementation\DefaultRenderer\render().
Here is the call graph for this function:
|
private |
Definition at line 38 of file DefaultRenderer.php.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\getContexts().