ILIAS  release_8 Revision v8.24
empty_options.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
10function empty_options()
11{
12 global $DIC;
13 $ui = $DIC->ui()->factory();
14 $renderer = $DIC->ui()->renderer();
15 $request = $DIC->http()->request();
16
17 $multi = $ui->input()->field()
18 ->multiselect("No options", []);
19
20 $form = $ui->input()->container()->form()->standard('#', ['empty' => $multi]);
21
22 if ($request->getMethod() == "POST") {
23 try {
24 $form = $form->withRequest($request);
25 $result = $form->getData();
26 } catch (\InvalidArgumentException $e) {
27 $result = "No result. Probably, the other form was used.";
28 }
29 } else {
30 $result = "No result yet.";
31 }
32
33 return
34 "<pre>" . print_r($result, true) . "</pre><br/>" .
35 $renderer->render($form);
36}
global $DIC
Definition: feed.php:28
empty_options()
Multi-Select without options.