Go to the source code of this file.
◆ base()
Base example showing how to plug a checkbox into a form.
Definition at line 5 of file base.php.
6{
7
9 $ui =
$DIC->ui()->factory();
10 $renderer =
$DIC->ui()->renderer();
12
13
14 $checkbox_input = $ui->input()->field()->checkbox("Checkbox", "Check or not.")
15 ->withValue('checked');
16
17
18 $DIC->ctrl()->setParameterByClass(
19 'ilsystemstyledocumentationgui',
20 'example_name',
21 'base_checkbox'
22 );
23 $form_action =
$DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
24 $form = $ui->input()->container()->form()->standard($form_action, [ $checkbox_input]);
25
26
27
29 &&
$request->getQueryParams()[
'example_name'] ==
'base_checkbox') {
32 } else {
34 }
35
36
37 return
38 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
39 $renderer->render(
$form);
40}
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form
References $DIC, $form, $request, and $result.