3 declare(strict_types=1);
23 $factory = $DIC->ui()->factory();
25 $df = new \ILIAS\Data\Factory();
27 $here_uri = $df->uri($DIC->http()->request()->getUri()->__toString());
29 $example_namespace = [
'prompt',
'close'];
30 list($url_builder, $action_token) = $url_builder->acquireParameters(
36 $query = $DIC->http()->wrapper()->query();
37 if ($query->has($action_token->getName())) {
38 $action = $query->retrieve($action_token->getName(),
$refinery->kindlyTo()->string());
39 if ($action ===
'closecommand') {
41 $response = $factory->prompt()->state()->close();
44 $close = $factory->link()->standard(
46 $url_builder->withParameter($action_token,
'closecommand')->buildURI()->__toString()
49 $message = $factory->messageBox()->info(
'some message box')
50 ->withLinks([$close]);
51 $response = $factory->prompt()->state()->show($message);
58 $prompt = $factory->prompt()->standard($url_builder->buildURI());
60 $factory->button()->standard(
'Show Prompt', $prompt->getShowSignal()),
base()
description: > The example demonstrates how to use commands in the Response.