Go to the source code of this file.
|
| with_limits () |
| This example shows how to create and render a basic textarea field with minimum and maximum number of characters limit. More...
|
|
◆ with_limits()
This example shows how to create and render a basic textarea field with minimum and maximum number of characters limit.
the input is attached to a form.
Definition at line 6 of file with_limits.php.
References $DIC, and $result.
10 $ui = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
13 $request = $DIC->http()->request();
19 $textarea_input = $ui->input()->field()->textarea(
"Textarea Input",
"Just a textarea input.")->withMinLimit($min_limit)->withMaxLimit($max_limit);
22 $DIC->ctrl()->setParameterByClass(
23 'ilsystemstyledocumentationgui',
27 $form_action = $DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
30 $form = $ui->input()->container()->form()->standard($form_action, [$textarea_input]);
33 if ($request->getMethod() ==
"POST" && $request->getQueryParams()[
'example_name'] ==
'with_limits') {
34 $form = $form->withRequest($request);
42 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
43 $renderer->render($form);