Go to the source code of this file.
◆ with_required_input()
Example showing a Form with required fields.
An explaining hint is displayed below the Form.
Definition at line 8 of file with_required_input.php.
9{
11 $ui =
$DIC->ui()->factory();
12 $renderer =
$DIC->ui()->renderer();
13
14 $text_input = $ui->input()->field()
15 ->text("Required Input", "User needs to fill this field")
16 ->withRequired(true);
17
18 $section = $ui->input()->field()->section(
19 [$text_input],
20 "Section with required field",
21 "The Form should show an explaining hint at the bottom"
22 );
23
24 $form = $ui->input()->container()->form()->standard(
"", [
$section]);
25 return $renderer->render($form);
26}
References $DIC, and $section.