ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
reduce_with.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
ILIAS\UI\examples\Input\Container\Form\Standard
;
6
37
function
reduce_with
()
38
{
39
global
$DIC
;
40
$ui =
$DIC
->ui()->factory();
41
$renderer
=
$DIC
->ui()->renderer();
42
43
$text_input = $ui->input()->field()
44
->text(
"Required Input"
,
"User needs to fill this field"
)
45
->withRequired(
true
);
46
47
$section = $ui->input()->field()->section(
48
[$text_input],
49
"Section with required field"
,
50
"The Form should show an explaining hint at the bottom"
51
);
52
53
$form = $ui->input()->container()->form()->standard(
""
, [$section, $section, $text_input]);
54
55
$array = $form->reduceWith(
56
fn(
$c
,
$res
) => [
$c
->getCanonicalName() =>
$res
]
57
);
58
59
return
$renderer
->render([
60
$ui->legacy()->content(
'<pre>'
. print_r(json_encode($array, JSON_PRETTY_PRINT),
true
) .
'</pre>'
),
61
]);
62
}
$renderer
$renderer
Definition:
build_bootstrap.php:83
$c
$c
Definition:
deliver.php:25
$res
$res
Definition:
ltiservices.php:69
ILIAS\UI\examples\Input\Container\Form\Standard
Definition:
base.php:21
ILIAS\UI\examples\Input\Container\Form\Standard\reduce_with
reduce_with()
Definition:
reduce_with.php:37
$DIC
global $DIC
Definition:
shib_login.php:26
components
ILIAS
UI
src
examples
Input
Container
Form
Standard
reduce_with.php
Generated on Sat Oct 18 2025 23:04:40 for ILIAS by
1.9.4 (using
Doxyfile
)