ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
17 function base()
18 {
19  // Step 0: Declare dependencies.
20  global $DIC;
21  $ui = $DIC->ui()->factory();
22  $renderer = $DIC->ui()->renderer();
23 
24  // Step 1: Define the input field.
25  // See the implementation of a UploadHandler in components/ILIAS/UI_/classes/class.ilUIDemoFileUploadHandlerGUI.php
26  $file_input = $ui->input()->field()->file(new \ilUIDemoFileUploadHandlerGUI(), "Upload File", "you can drop your files here");
27 
28  // Step 2: Define the form and attach the field.
29  $form = $ui->input()->container()->form()->standard("#", [$file_input]);
30 
31  // Step 4: Render the form.
32  return $renderer->render($form);
33 }
$renderer
Class ilUIDemoFileUploadHandlerGUI.
global $DIC
Definition: shib_login.php:25
base()
description: > Example of how to create and render a file input field and attach it to a form...
Definition: base.php:17