ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
base_with_value.php File Reference

Go to the source code of this file.

Functions

 base_with_value ()
 Example show how to create and render a basic tag input field and attach it to a form. More...
 

Function Documentation

◆ base_with_value()

base_with_value ( )

Example show how to create and render a basic tag input field and attach it to a form.

This example does not contain any data processing.

Definition at line 6 of file base_with_value.php.

7{
8 //Step 0: Declare dependencies
9 global $DIC;
10 $ui = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
12
13 //Step 1: Define the tag input field
14 $multi_select_input = $ui->input()->field()->tag(
15 "Basic TagInput",
16 ['Interesting', 'Boring', 'Animating', 'Repetitious'],
17 "Just some tags"
18 )->withValue(["Interesting"]);
19
20 //Step 2, define form and form actions
21 $form = $ui->input()->container()->form()->standard("#", [$multi_select_input]);
22
23 //Return the rendered form
24 return $renderer->render($form);
25}
$DIC
Definition: xapitoken.php:46

References $DIC.