Go to the source code of this file.
|
| base () |
| Example show how to create and render a basic textarea field and attach it to a form. More...
|
|
◆ base()
Example show how to create and render a basic textarea field and attach it to a form.
Definition at line 6 of file base.php.
7{
8
10 $ui =
$DIC->ui()->factory();
11 $request =
$DIC->http()->request();
12 $renderer =
$DIC->ui()->renderer();
13
14
15 $textarea_input = $ui->input()->field()->textarea("Textarea Input", "Just a textarea input.");
16
17
18 $DIC->ctrl()->setParameterByClass(
19 'ilsystemstyledocumentationgui',
20 'example_name',
21 'base'
22 );
23 $form_action =
$DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
24
25
26 $form = $ui->input()->container()->form()->standard($form_action, [$textarea_input]);
27
28
29 if ($request->getMethod() == "POST" && $request->getQueryParams()['example_name'] == 'base') {
30 $form = $form->withRequest($request);
32 } else {
34 }
35
36
37 return
38 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
39 $renderer->render($form);
40}
References $DIC, and $result.