37 $root = $root ?? $this;
40 if (is_array($component)) {
41 foreach ($component as $_component) {
42 $out .= $root->render($_component);
46 $out = $renderer->render($component, $root);
57 $root = $root ?? $this;
60 if (is_array($component)) {
61 foreach ($component as $_component) {
62 $out .= $root->renderAsync($_component);
83 return $this->component_renderer_loader->getRendererFor($component, $this->
getContexts());
94 return $this->component_renderer_loader
95 ->getRendererFactoryFor($component)
97 ->getOnLoadCodeAsync();
105 $clone = clone $this;
An exception for terminatinating execution or to throw for unit testing.
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the ...
withAdditionalContext(Component $context)
Get a new renderer with an additional context.A context makes it possible to use another renderer for...
getContexts()
Get the contexts that are added via withAdditionalContext where most recently added contexts come las...
$component_renderer_loader
getJSCodeForAsyncRenderingFor(Component $component)
Get JS-Code for asynchronous rendering of component.
getRendererFor(Component $component)
Get a renderer for a certain Component class.
renderAsync($component, ?Renderer $root=null)
Same as render, except that this version also returns any javascript code bound to the on load event,...
__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...
A component is the most general form of an entity in the UI.
An entity that renders components to a string output.
An entity that renders components to a string output.