ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
36 function base()
37 {
38  global $DIC;
39  $ui = $DIC->ui()->factory();
40  $renderer = $DIC->ui()->renderer();
41  $request = $DIC->http()->request();
42 
43  $link_input = $ui->input()->field()->link("Link Input", "Enter a label and the url ")
44  ->withValue(['ILIAS Homepage', "https://www.ilias.de/"]);
45 
46  $form = $ui->input()->container()->form()->standard("#", [$link_input]);
47 
48  $result = "No result yet.";
49  if ($request->getMethod() == "POST") {
50  $form = $form->withRequest($request);
51  $data = $form->getData();
52  if ($data) {
53  $result = $data[0];
54  }
55  }
56 
57  return
58  "<pre>" . print_r($result, true) . "</pre><br />" .
59  $renderer->render($form);
60 }
$renderer
global $DIC
Definition: shib_login.php:22