10 $ui = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
12 $request = $DIC->http()->request();
15 $tag_input = $ui->input()->field()->tag(
17 [
'Interesting & fascinating',
'Boring, dull',
'Animating',
'Repetitious'],
22 $form = $ui->input()->container()->form()->standard(
'#', [
'f2' => $tag_input]);
25 if ($request->getMethod() ===
"POST") {
26 $form = $form->withRequest($request);
36 . $renderer->render($form);
base_with_data()
Example show how to create and render a basic tag input field and attach it to a form.