Go to the source code of this file.
◆ with_required()
Base example showing how to plug a Select into a form.
Definition at line 5 of file with_required.php.
6{
7
8
10
11 $ui =
$DIC->ui()->factory();
12 $renderer =
$DIC->ui()->renderer();
15
16
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(
"Choose an Option",
$options,
"This is the byline text")->withRequired(
true);
26
27
28 $ctrl->setParameterByClass(
29 'ilsystemstyledocumentationgui',
30 'example_name_required',
31 'select'
32 );
33 $form_action =
$DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui');
34 $form = $ui->input()->container()->form()->standard($form_action, [$select]);
35
36
38 &&
$request->getQueryParams()[
'example_name_required'] ==
"select") {
41 } else {
43 }
44
45
46 return
47 "<pre>" . print_r(
$result,
true) .
"</pre><br/>" .
48 $renderer->render(
$form);
49}
foreach($paths as $path) $request
if(isset($_POST['submit'])) $form
References $DIC, $form, PHPMailer\PHPMailer\$options, $request, and $result.