3 declare(strict_types=1);
22 $ui = $DIC->ui()->factory();
24 $request = $DIC->http()->request();
26 $text_input = $ui->input()->field()
27 ->text(
"Required Input",
"User needs to fill this field")
30 $section = $ui->input()->field()->section(
32 "Section with required field",
33 "The Form should show an explaining hint at the bottom" 36 $DIC->ctrl()->setParameterByClass(
37 'ilsystemstyledocumentationgui',
41 $form_action = $DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
43 $form = $ui->input()->container()->form()->standard($form_action, [$section]);
45 if ($request->getMethod() ==
"POST" 46 && array_key_exists(
'example_name', $request->getQueryParams())
47 && $request->getQueryParams()[
'example_name'] ==
'required') {
48 $form = $form->withRequest($request);
49 $result = $form->getData();
51 $result =
"No result yet.";
55 "<pre>" . print_r($result,
true) .
"</pre><br/>" .