ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
base_with_value.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
38 function base_with_value()
39 {
40  //Step 0: Declare dependencies
41  global $DIC;
42  $ui = $DIC->ui()->factory();
43  $renderer = $DIC->ui()->renderer();
44 
45  //Step 1: Define the tag input field
46  $tag_input = $ui->input()->field()->tag(
47  "Basic TagInput",
48  ['Interesting', 'Boring', 'Animating', 'Repetitious'],
49  "Just some tags"
50  )->withValue(["Interesting"]);
51 
52  //Step 2, define form and form actions
53  $form = $ui->input()->container()->form()->standard("#", [$tag_input]);
54 
55  //Return the rendered form
56  return $renderer->render($form);
57 }
$renderer
base_with_value()
description: > The example shows how to create and render a basic tag input field and attach it to a...
global $DIC
Definition: shib_login.php:22