Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250530) (c39b7370636)
core\output\mustache_clean_string_helper Class Reference

Public Member Functions

 __construct ()
 Create new instance of mustache clean string helper.
 
 cleanstr ($text, Mustache_LambdaHelper $helper)
 Read a lang string from a template and get it from get_string.
 

Member Function Documentation

◆ cleanstr()

core\output\mustache_clean_string_helper::cleanstr ( $text,
Mustache_LambdaHelper $helper )

Read a lang string from a template and get it from get_string.

Some examples for calling this from a template are:

{{#cleanstr}}activity{{/cleanstr}} {{#cleanstr}}actionchoice, core, {{#str}}delete{{/str}}{{/cleanstr}} (Together with the str helper) {{#cleanstr}}uploadrenamedchars, core, {"oldname":"Old", "newname":"New"}{{/cleanstr}} (Complex $a)

The args are comma separated and only the first is required. The last is a $a argument for get string. For complex data here, use JSON.

Parameters
string$textThe text to parse for arguments.
Mustache_LambdaHelper$helperUsed to render nested mustache variables.
Return values
string

The documentation for this class was generated from the following file: