3 declare(strict_types=1);
16 $ui = $DIC->ui()->factory();
17 $renderer = $DIC->ui()->renderer();
18 $request = $DIC->http()->request();
23 $duration = $ui->input()->field()->duration(
"Pick a time-span",
"This is the byline text");
25 ->withTimezone(
'America/El_Salvador')
27 ->withByline(
'timezone and both time and date');
29 $time = $duration->withTimeOnly(
true)->withRequired(
true)->withLabels(
'start time',
'end time');
32 $form = $ui->input()->container()->form()->standard(
35 'duration' => $duration,
37 'timezone' => $timezone,
38 'disabled' => $duration->withLabel(
'disabled')->withDisabled(
true)
45 if ($request->getMethod() ==
"POST") {
46 $form = $form->withRequest($request);
47 $groups = $form->getInputs();
48 foreach ($groups as $group) {
49 if ($group->getError()) {
50 $result = $group->getError();
53 $result = $form->getData();
57 $result =
"No result yet.";
62 "<pre>" . print_r($result,
true) .
"</pre><br/>" .
63 $renderer->render($form);