ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
11 function base()
12 {
13  //Step 0: Declare dependencies
14  global $DIC;
15  $ui = $DIC->ui()->factory();
16  $renderer = $DIC->ui()->renderer();
17 
18  //Step 1: Define the text input field
19  $hidden = $ui->input()->field()->hidden()->withValue("csrf_token_or_some_other_persistent_data");
20 
21  //Step 2: Define the form and attach the section.
22  $form = $ui->input()->container()->form()->standard("#", [$hidden]);
23 
24  //Step 4: Render the form with the text input field
25  return $renderer->render($form);
26 }
base()
Example show how to create and render a basic hidden input field and attach it to a form...
Definition: base.php:11
global $DIC
Definition: feed.php:28