ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
base_with_value.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
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
global $DIC
Definition: shib_login.php:26