19declare(strict_types=1);
46 RendererInterface $default_renderer
55 $tpl->setVariable(
"INPUTS", $default_renderer->render($component->getInputGroup()));
57 $enriched_component = $component->withAdditionalOnLoadCode(
58 static function (
string $id) use ($component):
string {
60 // @TODO: we need to refactor the signal-management to prevent using jQuery here.
61 $(document).on('{$component->getSubmitSignal()}', function () {
62 let form = document.getElementById('$id');
63 if (!form instanceof HTMLFormElement) {
64 throw new Error(`Element '$id' is not an instance of HTMLFormElement.`);
67 // @TODO: we should use the triggering button as an emitter here. When doing
68 // so, please also change file.js processFormSubmissionHook().
76 $tpl->setVariable(
"ID",
$id);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
renderFormWithoutSubmitButtons(Form\Standard $component, RendererInterface $default_renderer)
render(Component\Component $component, RendererInterface $default_renderer)
Base class for all component renderers.
cannotHandleComponent(Component $component)
This method MUST be called by derived component renderers, if.
createId()
Get a fresh unique id.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
Interface to templating as it is used in the UI framework.
An entity that renders components to a string output.