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