ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
base_with_value.php
Go to the documentation of this file.
1<?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}
base_with_value()
Example show how to create and render a basic tag input field and attach it to a form.
An exception for terminatinating execution or to throw for unit testing.
$DIC
Definition: xapitoken.php:46