ILIAS  release_7 Revision v7.30-3-g800a261c036
with_required_input.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
9{
10 global $DIC;
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}
$section
Definition: Utf8Test.php:83
An exception for terminatinating execution or to throw for unit testing.
global $DIC
Definition: goto.php:24
with_required_input()
Example showing a Form with required fields.