ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
empty_options.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
37function empty_options()
38{
39 global $DIC;
40 $ui = $DIC->ui()->factory();
41 $renderer = $DIC->ui()->renderer();
42 $request = $DIC->http()->request();
43
44 $multi = $ui->input()->field()
45 ->multiselect("No options", []);
46
47 $form = $ui->input()->container()->form()->standard('#', ['empty' => $multi]);
48
49 if ($request->getMethod() == "POST") {
50 try {
51 $form = $form->withRequest($request);
52 $result = $form->getData();
53 } catch (\InvalidArgumentException $e) {
54 $result = "No result. Probably, the other form was used.";
55 }
56 } else {
57 $result = "No result yet.";
58 }
59
60 return
61 "<pre>" . print_r($result, true) . "</pre><br/>" .
62 $renderer->render($form);
63}
$renderer
global $DIC
Definition: shib_login.php:26