ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
disabled.php File Reference

Go to the source code of this file.

Functions

 disabled ()
 Example show how to create and render a disabled text input field and attach it to a form. More...
 

Function Documentation

◆ disabled()

disabled ( )

Example show how to create and render a disabled text input field and attach it to a form.

This example does not contain any data processing.

Definition at line 6 of file disabled.php.

References $DIC.

7 {
8  //Step 0: Declare dependencies
9  global $DIC;
10  $ui = $DIC->ui()->factory();
11  $renderer = $DIC->ui()->renderer();
12 
13  //Step 1: Define the text input field
14  $text_input = $ui->input()->field()->text("Disabled Input", "Just some disabled input")->withDisabled(true);
15 
16  //Step 2: Define the form and attach the section.
17  $form = $ui->input()->container()->form()->standard("#", [$text_input]);
18 
19  //Step 4: Render the form with the text input field
20  return $renderer->render($form);
21 }
global $DIC
Definition: goto.php:24