Go to the source code of this file.
|
| base_with_data () |
| Example show how to create and render a basic tag input field and attach it to a form. More...
|
|
◆ base_with_data()
Example show how to create and render a basic tag input field and attach it to a form.
This example does not contain any data processing.
Definition at line 6 of file base_with_data.php.
7{
8
10 $ui =
$DIC->ui()->factory();
11 $renderer =
$DIC->ui()->renderer();
12 $request =
$DIC->http()->request();
13
14
15 $tag_input = $ui->input()->field()->tag(
16 "Basic TagInput",
17 ['Interesting & fascinating', 'Boring, dull', 'Animating', 'Repetitious'],
18 "Just some tags"
19 );
20
21
22 $form = $ui->input()->container()->form()->standard('#', ['f2' => $tag_input]);
23
24
25 if ($request->getMethod() === "POST") {
26 $form = $form->withRequest($request);
28 } else {
30 }
31
32
33 return "<pre>"
35 . "</pre><br/>"
36 . $renderer->render($form);
37}
References $DIC, and $result.