ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
with_mustache_variables.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
35function with_mustache_variables(): string
36{
37 global $DIC;
38
39 $factory = $DIC->ui()->factory();
40 $renderer = $DIC->ui()->renderer();
41
42 $input = $factory->input()->field()->markdown(
44 "Create template",
45 "You can use Mustache variables here, how fun :).",
46 );
47
48 $input = $input->withMustacheVariables(
49 [
50 'var1' => 'Test Variable 1',
51 'var2' => 'Test Variable 2',
52 'var3' => 'Test Variable 3',
53 ],
54 'Also, some more info could be added here as well.'
55 );
56
57 $form = $factory->input()->container()->form()->standard('#', [$input]);
58
59 return $renderer->render($form);
60}
$renderer
global $DIC
Definition: shib_login.php:26