ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
with_value.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
18 function with_value()
19 {
20  //Step 0: Declare dependencies
21  global $DIC;
22  $ui = $DIC->ui()->factory();
23  $renderer = $DIC->ui()->renderer();
24 
25  //Step 1: Define the text input field and attach some default value
26  $text_input = $ui->input()->field()->text("Basic Input", "Just some basic input
27  with some default value.")
28  ->withValue("Default Value");
29 
30  //Step 2: Define the form and attach the section.
31  $form = $ui->input()->container()->form()->standard("#", [$text_input]);
32 
33  //Step 4: Render the form with the text input field
34  return $renderer->render($form);
35 }
$renderer
global $DIC
Definition: shib_login.php:25
with_value()
description: > Example shows how to create and render a basic text input field with an value attache...
Definition: with_value.php:18