ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  $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 }
global $DIC
Definition: saml.php:7
base_with_value()
Example show how to create and render a basic tag input field and attach it to a form.
if(isset($_POST['submit'])) $form