ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
base_with_value.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
22 function base_with_value()
23 {
24  //Step 0: Declare dependencies
25  global $DIC;
26  $ui = $DIC->ui()->factory();
27  $renderer = $DIC->ui()->renderer();
28 
29  //Step 1: Define the tag input field
30  $tag_input = $ui->input()->field()->tag(
31  "Basic TagInput",
32  ['Interesting', 'Boring', 'Animating', 'Repetitious'],
33  "Just some tags"
34  )->withValue(["Interesting"]);
35 
36  //Step 2, define form and form actions
37  $form = $ui->input()->container()->form()->standard("#", [$tag_input]);
38 
39  //Return the rendered form
40  return $renderer->render($form);
41 }
$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:25