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()->textarea(
43 "Create template",
44 "You can use Mustache variables here, how fun :).",
45 );
46
47 $input = $input->withMustacheVariables(
48 [
49 'var1' => 'Test Variable 1',
50 'var2' => 'Test Variable 2',
51 'var3' => 'Test Variable 3',
52 ],
53 'Also, some more info could be added here as well.'
54 );
55
56 $form = $factory->input()->container()->form()->standard('#', [$input]);
57
58 return $renderer->render($form);
59}
$renderer
global $DIC
Definition: shib_login.php:26