ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
|
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 (private Render\Loader $component_renderer_loader, private JavaScriptBinding $java_script_binding, private \ILIAS\Language\Language $language,) | |||||||
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.
| |||||||
render ($component, ?Renderer $root=null) | |||||||
Render given component. More... | |||||||
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. More... | |||||||
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, | ||
private \ILIAS\Language\Language | $language | ||
) |
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 112 of file DefaultRenderer.php.
References ILIAS\UI\Implementation\DefaultRenderer\$contexts.
Referenced by TestDefaultRenderer\_getContexts(), and ILIAS\UI\Implementation\DefaultRenderer\getRendererFor().
|
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 101 of file DefaultRenderer.php.
References ILIAS\UI\Implementation\DefaultRenderer\getContexts().
Referenced by ILIAS\UI\Implementation\DefaultRenderer\render().
|
protected |
Removes the most recently added component from the current context stack.
This mainly serves for testability.
Definition at line 129 of file DefaultRenderer.php.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\render().
|
protected |
Adds a component to the current context stack.
This mainly serves for testability.
Definition at line 120 of file DefaultRenderer.php.
Referenced by TestDefaultRenderer\__construct(), and 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 50 of file DefaultRenderer.php.
References $out, $renderer, ILIAS\UI\Implementation\DefaultRenderer\getRendererFor(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\UI\Implementation\DefaultRenderer\popContext(), and ILIAS\UI\Implementation\DefaultRenderer\pushContext().
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 78 of file DefaultRenderer.php.
References $out, and ILIAS\UI\Implementation\DefaultRenderer\render().
|
private |
Definition at line 38 of file DefaultRenderer.php.
Referenced by ILIAS\UI\Implementation\DefaultRenderer\getContexts().