Go to the source code of this file.
|
| base () |
| Base example showing how to plug a Multi-Select into a form. More...
|
|
◆ base()
Base example showing how to plug a Multi-Select into a form.
Definition at line 5 of file base.php.
6{
7
8
10
11 $ui =
$DIC->ui()->factory();
12 $renderer =
$DIC->ui()->renderer();
15
16
18 "1" => "Pick 1",
19 "2" => "Pick 2",
20 "3" => "Pick 3",
21 "4" => "Pick 4",
22 );
23
24
25 $multi = $ui->input()->field()->multiselect(
"Take your picks",
$options,
"This is the byline text")
26 ->withRequired(true);
27
28
29 $ctrl->setParameterByClass(
30 'ilsystemstyledocumentationgui',
31 'example_name_required',
32 'multiselect'
33 );
34 $form_action =
$DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
35 $form = $ui->input()->container()->form()->standard($form_action, [
'multi' => $multi]);
36
37
39 &&
$request->getQueryParams()[
'example_name_required'] ==
"multiselect") {
42 } else {
44 }
45
46
47 return
48 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
49 $renderer->render(
$form);
50}
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form
References $DIC, $form, PHPMailer\PHPMailer\$options, $request, and $result.