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 
20 function base()
21 {
22  global $DIC;
23  $ui = $DIC->ui()->factory();
24  $renderer = $DIC->ui()->renderer();
25  $request = $DIC->http()->request();
26 
27  $link_input = $ui->input()->field()->link("Link Input", "Enter a label and the url ")
28  ->withValue(['ILIAS Homepage', "https://www.ilias.de/"]);
29 
30  $form = $ui->input()->container()->form()->standard("#", [$link_input]);
31 
32  $result = "No result yet.";
33  if ($request->getMethod() == "POST") {
34  $form = $form->withRequest($request);
35  $data = $form->getData();
36  if ($data) {
37  $result = $data[0];
38  }
39  }
40 
41  return
42  "<pre>" . print_r($result, true) . "</pre><br />" .
43  $renderer->render($form);
44 }
$renderer
global $DIC
Definition: shib_login.php:25