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.
References $DIC, and $result.
9 $ui = $DIC->ui()->factory();
10 $renderer = $DIC->ui()->renderer();
11 $request = $DIC->http()->request();
14 $dependant_field = $ui->input()->field()->text(
"Item 1",
"Just some dependent group field");
17 $checkbox_input = $ui->input()->field()->optionalGroup(
18 [
"dependant_field" => $dependant_field],
20 "Check to display group field." 24 $form = $ui->input()->container()->form()->standard(
'#', [ $checkbox_input]);
28 if ($request->getMethod() ==
"POST") {
29 $form = $form->withRequest($request);
37 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
38 $renderer->render($form);