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.
References $DIC, and $result.
9 $ui = $DIC->ui()->factory();
10 $renderer = $DIC->ui()->renderer();
11 $request = $DIC->http()->request();
14 $some_input = $ui->input()->field()
15 ->text(
"Input",
"Any Input");
18 $DIC->ctrl()->setParameterByClass(
19 'ilsystemstyledocumentationgui',
23 $form_action = $DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
27 $form = $ui->input()->container()->form()->standard(
29 [
'input1' => $some_input->withLabel(
"Input 1")
30 ,
'input2' => $some_input->withLabel(
"Input 2")
35 if ($request->getMethod() ==
"POST" 36 && $request->getQueryParams()[
'example_name'] ==
'keys') {
37 $form = $form->withRequest($request);
45 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
46 $renderer->render($form);