ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
with_dedicated_name.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
13 {
14  global $DIC;
15  $ui = $DIC->ui()->factory();
16  $renderer = $DIC->ui()->renderer();
17 
18  $text_input = $ui->input()->field()
19  ->text("Username", "A username")
20  ->withDedicatedName('username');
21 
22  // Inputs with and without dedicated names can be mixed
23  $password_input = $ui->input()->field()
24  ->password("Password", "A secret password");
25 
26  $duration_input = $ui->input()->field()
27  ->duration("Valid from/to")
28  ->withDedicatedName('valid');
29 
30  $form = $ui->input()->container()->form()->standard("", [$text_input, $password_input, $duration_input]);
31  return $renderer->render($form);
32 }
global $DIC
Definition: feed.php:28
with_dedicated_name()
Example showing an Input with an optional dedicated name which is used as NAME attribute on the rende...