Go to the source code of this file.
|
| disabled () |
| Example showing how to plug a disabled Select into a form. More...
|
|
◆ disabled()
Example showing how to plug a disabled Select into a form.
Definition at line 5 of file disabled.php.
6{
7
8
10
11 $ui =
$DIC->ui()->factory();
12 $renderer =
$DIC->ui()->renderer();
13 $request =
$DIC->http()->request();
15
16
17 $options = array(
18 "1" => "Type 1",
19 "2" => "Type 2",
20 "3" => "Type 3",
21 "4" => "Type 4",
22 );
23
24
25 $select = $ui->input()->field()->select("Cannot choose an Option", $options, "This is the byline text")
26 ->withDisabled(true);
27
28
29 $form = $ui->input()->container()->form()->standard('#', [$select]);
30
31
32 if ($request->getMethod() == "POST") {
33 $form = $form->withRequest($request);
35 } else {
37 }
38
39
40 return
41 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
42 $renderer->render($form);
43}
References $DIC, and $result.