18 declare(strict_types=1);
36 $factory = $DIC->ui()->factory();
39 $group_one = $factory->input()->field()->group([$factory->input()->field()->text(
"Item 1",
"Just some field")],
"Group 1");
40 $group_two = $factory->input()->field()->group([$factory->input()->field()->text(
"Item 2",
"Just some field")],
"Group 2");
42 $switchable_group = $factory->input()->field()->switchableGroup(
43 [$group_one, $group_two],
44 "Switchable Group with existing value(s)",
48 $direct_value = $switchable_group->withValue(1);
51 $nested_value = $switchable_group->withValue([1, [
'some existing text value']]);
53 $form = $factory->input()->container()->form()->standard(
'#', [$direct_value, $nested_value]);