ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
base.php File Reference

Go to the source code of this file.

Functions

 base ()
 Example of how to create and render a basic password field and attach it to a form. More...
 

Function Documentation

◆ base()

base ( )

Example of how to create and render a basic password field and attach it to a form.

Definition at line 5 of file base.php.

References $DIC, and $form.

6 {
7  //Step 0: Declare dependencies.
8  global $DIC;
9  $ui = $DIC->ui()->factory();
10  $renderer = $DIC->ui()->renderer();
11 
12  //Step 1: Define the input field.
13  $pwd_input = $ui->input()->field()->password("Password", "enter your password here");
14 
15  //Step 2: Define the form and attach the field.
16  $form = $ui->input()->container()->form()->standard("#", [$pwd_input]);
17 
18  //Step 4: Render the form.
19  return $renderer->render($form);
20 }
global $DIC
Definition: saml.php:7
if(isset($_POST['submit'])) $form