Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
core\output\mustache_string_helper Class Reference

This class will load language strings in a template. More...

Public Member Functions

 str ($text, Mustache_LambdaHelper $helper)
 Read a lang string from a template and get it from get_string.
 

Detailed Description

This class will load language strings in a template.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
2.9

Member Function Documentation

◆ str()

core\output\mustache_string_helper::str ( $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:

{{#str}}activity{{/str}} {{#str}}actionchoice, core, {{#str}}delete{{/str}}{{/str}} (Nested) {{#str}}addinganewto, core, {"what":"This", "to":"That"}{{/str}} (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: