ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
base.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
ILIAS\UI\examples\Input\Field\File
;
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
$renderer
Definition:
build_bootstrap.php:83
ilUIDemoFileUploadHandlerGUI
Class ilUIDemoFileUploadHandlerGUI.
Definition:
class.ilUIDemoFileUploadHandlerGUI.php:31
$DIC
global $DIC
Definition:
shib_login.php:25
ILIAS\UI\examples\Input\Field\File\base
base()
description: > Example of how to create and render a file input field and attach it to a form...
Definition:
base.php:17
ILIAS\UI\examples\Input\Field\File
Definition:
base.php:5
components
ILIAS
UI
src
examples
Input
Field
File
base.php
Generated on Wed Sep 10 2025 15:16:44 for ILIAS by
1.8.13 (using
Doxyfile
)