ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
base_with_value.php
Go to the documentation of this file.
1 <?php
6 function base_with_value()
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  $tag_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("#", [$tag_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.
global $DIC
Definition: goto.php:24