3 declare(strict_types=1);
15 $ui = $DIC->ui()->factory();
16 $renderer = $DIC->ui()->renderer();
17 $request = $DIC->http()->request();
22 $duration = $ui->input()->field()->duration(
"Pick a time-span",
"This is the byline text");
24 ->withTimezone(
'America/El_Salvador')
26 ->withByline(
'timezone and both time and date');
28 $time =
$duration->withTimeOnly(
true)->withRequired(
true)->withLabels(
'start time',
'end time');
31 $form = $ui->input()->container()->form()->standard(
36 'timezone' => $timezone,
37 'disabled' =>
$duration->withLabel(
'disabled')->withDisabled(
true)
44 if ($request->getMethod() ==
"POST") {
45 $form = $form->withRequest($request);
46 $groups = $form->getInputs();
47 foreach ($groups as $group) {
48 if ($group->getError()) {
49 $result = $group->getError();
52 $result = $form->getData();
56 $result =
"No result yet.";
61 "<pre>" . print_r($result,
true) .
"</pre><br/>" .
62 $renderer->render($form);