6{
7
9 $ui =
$DIC->ui()->factory();
10 $renderer =
$DIC->ui()->renderer();
12
13
14
15 $dependant_field1 = $ui->input()->field()->text("Item 1", "Just some dependent group field");
16 $dependant_field2 = $ui->input()->field()->text("Item 2", "Just some dependent group field");
17 $dependant_fields = [
18 "dependant_field_a" => $dependant_field1,
19 "dependant_field_b" => $dependant_field2
20 ];
21
22 $radio_d = $ui->input()->field()->radio("Dep. Radio", "check an option")
23 ->withOption('value1', 'label1', 'byline1')
24 ->withOption('value2', 'label2', 'byline2', $dependant_fields);
25
26 $radio_num_value = $ui->input()->field()->radio("Numeric Values", "pick one...")
27 ->withOption('1', 'One', '')
28 ->withOption('2', 'Two', '')
29 ->withOption('3', 'Three', '');
30
31
32 $radio = $ui->input()->field()->radio("Radio", "check an option")
33 ->withOption('value1', 'label1', 'byline1')
34 ->withOption('value2', 'label2', 'byline2', $dependant_fields)
35 ->withOption('value3', 'label3', 'byline3', [$radio_d])
36 ->withOption('value4', 'numerics', 'test num values', [$radio_num_value]);
37
38
39
40 $DIC->ctrl()->setParameterByClass(
41 'ilsystemstyledocumentationgui',
42 'example_name',
43 'radio'
44 );
45 $form_action =
$DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
46 $form = $ui->input()->container()->form()->standard(
'#', [
'radio' => $radio]);
47
48
49
50 if (
$request->getMethod() ==
"POST") {
53 } else {
55 }
56
57
58 return
59 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
60 $renderer->render(
$form);
61}
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form