ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
with_dedicated_name.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
21 {
22  global $DIC;
23  $ui = $DIC->ui()->factory();
24  $renderer = $DIC->ui()->renderer();
25 
26  $text_input = $ui->input()->field()
27  ->text("Username", "A username")
28  ->withDedicatedName('username');
29 
30  // Inputs with and without dedicated names can be mixed
31  $password_input = $ui->input()->field()
32  ->password("Password", "A secret password");
33 
34  $duration_input = $ui->input()->field()
35  ->duration("Valid from/to")
36  ->withDedicatedName('valid');
37 
38  $form = $ui->input()->container()->form()->standard("", [$text_input, $password_input, $duration_input]);
39  return $renderer->render($form);
40 }
$renderer
global $DIC
Definition: shib_login.php:25
with_dedicated_name()
description: > Example showing an Input with an optional dedicated name which is used as NAME attrib...