9 $ui = $DIC->ui()->factory();
10 $renderer = $DIC->ui()->renderer();
11 $request = $DIC->http()->request();
14 $group1 = $ui->input()->field()->group(
16 "field_1_1" => $ui->input()->field()->text(
"Item 1.1",
"Just some field"),
17 "field_1_2" => $ui->input()->field()->text(
"Item 1.2",
"Just some other field")
19 "Switchable Group number one (with numeric key)" 21 $group2 = $ui->input()->field()->group(
23 "field_2_1" => $ui->input()->field()->text(
"Item 2",
"Just another field")
24 ->withValue(
'some val')
26 "Switchable Group number two" 28 $group3 = $ui->input()->field()->group([],
'No items in this group');
31 $sg = $ui->input()->field()->switchableGroup(
41 $form = $ui->input()->container()->form()->standard(
44 'switchable_group' => $sg,
47 'switchable_group2' => $sg->withValue(
"g2")
48 ->withLabel(
"Again, Pick One")
49 ->withByline(
"... or the other. 50 Note, the second option is selected by default here.")
55 if ($request->getMethod() ==
"POST") {
56 $form = $form->withRequest($request);
64 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
65 $renderer->render($form);