ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
with_error.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
35function with_error()
36{
37 //Declare dependencies
38 global $DIC;
39 $ui = $DIC->ui()->factory();
40 $renderer = $DIC->ui()->renderer();
41
42 //Define the text input field
43 $text_input = $ui->input()->field()->text("Basic Input", "Just some basic input
44 with some error attached.")
45 ->withError("Some error");
46
47 //Define the form and attach the section.
48 $form = $ui->input()->container()->form()->standard("#", [$text_input]);
49
50 //Render the form with the text input field
51 return $renderer->render($form);
52}
$renderer
global $DIC
Definition: shib_login.php:26