Go to the source code of this file.
|
| base () |
| Example showing how a dependant group (aka sub form) might be attached to a checkbox. More...
|
|
◆ base()
Example showing how a dependant group (aka sub form) might be attached to a checkbox.
Definition at line 5 of file base.php.
6{
7
9 $ui =
$DIC->ui()->factory();
10 $renderer =
$DIC->ui()->renderer();
11 $request =
$DIC->http()->request();
12
13
14 $dependant_field = $ui->input()->field()->text("Item 1", "Just some dependent group field");
15
16
17 $checkbox_input = $ui->input()->field()->optionalGroup(
18 ["dependant_field" => $dependant_field],
19 "Optional Group",
20 "Check to display group field."
21 );
22
23
24 $form = $ui->input()->container()->form()->standard('#', [ $checkbox_input]);
25
26
27
28 if ($request->getMethod() == "POST") {
29 $form = $form->withRequest($request);
31 } else {
33 }
34
35
36 return
37 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
38 $renderer->render($form);
39}
References $DIC, and $result.