Go to the source code of this file.
|
| with_keys () |
| Example showing how keys can be used when attaching input fields to a form. More...
|
|
◆ with_keys()
Example showing how keys can be used when attaching input fields to a form.
Definition at line 5 of file with_keys.php.
6{
7
9 $ui =
$DIC->ui()->factory();
10 $renderer =
$DIC->ui()->renderer();
12
13
14 $number_input = $ui->input()->field()
15 ->text("number", "Some numeric input");
16
17
18 $DIC->ctrl()->setParameterByClass(
19 'ilsystemstyledocumentationgui',
20 'example_name',
21 'keys'
22 );
23 $form_action =
$DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
24
25
26
27 $form = $ui->input()->container()->form()->standard(
28 $form_action,
29 [ 'input1' => $number_input->withLabel("Input 1")
30 , 'input2' => $number_input->withLabel("Input 2")
31 ]
32 );
33
34
36 &&
$request->getQueryParams()[
'example_name'] ==
'keys') {
39 } else {
41 }
42
43
44 return
45 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
46 $renderer->render(
$form);
47}
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form
References $DIC, $form, $request, and $result.