ILIAS  release_8 Revision v8.24
with_required_input.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
11{
12 global $DIC;
13 $ui = $DIC->ui()->factory();
14 $renderer = $DIC->ui()->renderer();
15
16 $text_input = $ui->input()->field()
17 ->text("Required Input", "User needs to fill this field")
18 ->withRequired(true);
19
20 $section = $ui->input()->field()->section(
21 [$text_input],
22 "Section with required field",
23 "The Form should show an explaining hint at the bottom"
24 );
25
26 $form = $ui->input()->container()->form()->standard("", [$section]);
27 return $renderer->render($form);
28}
global $DIC
Definition: feed.php:28
with_required_input()
Example showing a Form with required fields.