19 declare(strict_types=1);
42 $factory = $DIC->ui()->factory();
45 $df = new \ILIAS\Data\Factory();
48 $here_uri = $df->uri($DIC->http()->request()->getUri()->__toString());
52 $example_namespace = [
'prompt',
'endpoints'];
53 list($url_builder, $endpointtoken) = $url_builder->acquireParameters($example_namespace,
"endpoint");
54 $url_builder = $url_builder->withParameter($endpointtoken,
"true");
57 $query_namespace = [
'prompt',
'example2'];
58 list($url_builder, $action_token) = $url_builder->acquireParameters($query_namespace,
"action");
59 $url_builder = $url_builder->withParameter($action_token,
"form");
60 $prompt = $factory->prompt()->standard($url_builder->buildURI());
63 $query = $DIC->http()->wrapper()->query();
64 if ($query->has($action_token->getName())
65 && $query->has($action_token->getName())
66 && $query->retrieve($action_token->getName(),
$refinery->kindlyTo()->string()) ===
'form' 70 $uri = $url_builder->buildURI()->__toString();
71 $form = $factory->input()->container()->form()->standard(
74 $factory->input()->field()->text(
76 "write 'close' to close the prompt." 82 $response = $factory->prompt()->state()->show($form);
84 $request = $DIC->http()->request();
85 if ($request->getMethod() ===
'POST') {
86 $form = $form->withRequest($request);
87 $data = $form->getData();
93 $response = $factory->prompt()->state()->close();
95 $response = $factory->prompt()->state()->show($form);
103 if (!$query->has($endpointtoken->getName())) {
104 $show_button = $factory->button()->standard(
'Show Prompt with Form', $prompt->getShowSignal());
105 return $renderer->render([$prompt, $show_button]);
form()
description: > This shows a Form being used in a Prompt.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...