3 declare(strict_types=1);
35 $ui = $DIC->ui()->factory();
37 $request = $DIC->http()->request();
42 $duration = $ui->input()->field()->duration(
"Pick a time-span",
"This is the byline text");
44 ->withTimezone(
'America/El_Salvador')
46 ->withByline(
'timezone and both time and date');
48 $time =
$duration->withTimeOnly(
true)->withRequired(
true)->withLabels(
'start time',
'end time');
51 $form = $ui->input()->container()->form()->standard(
56 'timezone' => $timezone,
57 'disabled' =>
$duration->withLabel(
'disabled')->withDisabled(
true)
64 if ($request->getMethod() ==
"POST") {
65 $form = $form->withRequest($request);
66 $groups = $form->getInputs();
67 foreach ($groups as $group) {
68 if ($group->getError()) {
69 $result = $group->getError();
72 $result = $form->getData();
76 $result =
"No result yet.";
81 "<pre>" . print_r($result,
true) .
"</pre><br/>" .