Go to the source code of this file.
|
| disabled () |
| Example showing how to plug a disabled radio into a form. More...
|
|
◆ disabled()
Example showing how to plug a disabled radio into a form.
Definition at line 5 of file disabled.php.
6{
7
9 $ui =
$DIC->ui()->factory();
10 $renderer =
$DIC->ui()->renderer();
11 $request =
$DIC->http()->request();
12
13
14
15 $radio = $ui->input()->field()->radio("Radio", "Cannot check an option")
16 ->withOption('value1', 'label1')
17 ->withOption('value2', 'label2')
18 ->withOption('value3', 'label3')
19 ->withDisabled(true);
20
21
22
23 $form = $ui->input()->container()->form()->standard('#', ['radio' => $radio]);
24
25
26
27 if ($request->getMethod() == "POST") {
28 $form = $form->withRequest($request);
30 } else {
32 }
33
34
35 return
36 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
37 $renderer->render($form);
38}
References $DIC, and $result.