Go to the source code of this file.
◆ base()
Base example showing how to plug a radio into a form.
Definition at line 5 of file base.php.
References $DIC, $form, $request, and $result.
9 $ui = $DIC->ui()->factory();
10 $renderer = $DIC->ui()->renderer();
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");
18 "dependant_field_a" => $dependant_field1,
19 "dependant_field_b" => $dependant_field2
22 $radio_d = $ui->input()->field()->radio(
"Dep. Radio",
"check an option")
23 ->withOption(
'value1',
'label1',
'byline1')
24 ->withOption(
'value2',
'label2',
'byline2', $dependant_fields);
26 $radio_num_value = $ui->input()->field()->radio(
"Numeric Values",
"pick one...")
27 ->withOption(
'1',
'One',
'')
28 ->withOption(
'2',
'Two',
'')
29 ->withOption(
'3',
'Three',
'');
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]);
40 $DIC->ctrl()->setParameterByClass(
41 'ilsystemstyledocumentationgui',
45 $form_action = $DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
46 $form = $ui->input()->container()->form()->standard(
'#', [
'radio' => $radio]);
50 if (
$request->getMethod() ==
"POST") {
59 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
60 $renderer->render(
$form);
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form