ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
with_metadata.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
38 function with_metadata(): string
39 {
40  global $DIC;
41  $factory = $DIC->ui()->factory();
42  $renderer = $DIC->ui()->renderer();
43 
44  $file_input = $factory->input()->field()->file(
46  "Upload File",
47  "After choosing the file you can add additional metadata.",
48  $factory->input()->field()->switchableGroup([
49  $factory->input()->field()->group([$factory->input()->field()->text('New filename')], 'Yes'),
50  $factory->input()->field()->group([], 'No'),
51  ], 'Change filename?'),
52  );
53 
54  $form = $factory->input()->container()->form()->standard("#", [$file_input]);
55 
56  return $renderer->render($form);
57 }
$renderer
Class ilUIDemoFileUploadHandlerGUI.
with_metadata()
description: > Example of how to create and render a File Field with ab additional metadata Field an...
global $DIC
Definition: shib_login.php:26