Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Custom Moodle engine for mustache. More...
Public Member Functions | |
__construct (array $options=[]) | |
Mustache engine constructor. | |
addHelper ($name, $helper) | |
Add a new Mustache helper. | |
getCache () | |
Get the current Mustache Cache instance. | |
getCharset () | |
Get the current Mustache character set. | |
getCompiler () | |
Get the current Mustache Compiler instance. | |
getEntityFlags () | |
Get the current Mustache entitity type to escape. | |
getEscape () | |
Get the current Mustache escape callback. | |
getHelper ($name) | |
Get a Mustache helper by name. | |
getHelpers () | |
Get the current set of Mustache helpers. | |
getLoader () | |
Get the current Mustache template Loader instance. | |
getLogger () | |
Get the current Mustache Logger instance. | |
getParser () | |
Get the current Mustache Parser instance. | |
getPartialsLoader () | |
Get the current Mustache partials Loader instance. | |
getPragmas () | |
Get the current globally enabled pragmas. | |
getTemplateClassName ($source) | |
Helper method to generate a Mustache template class. | |
getTokenizer () | |
Get the current Mustache Tokenizer instance. | |
hasHelper ($name) | |
Check whether this Mustache instance has a helper. | |
loadLambda ($source, $delims=null) | |
Load a Mustache lambda Template by source. | |
loadPartial ($name) | |
Load a Mustache partial Template by name. | |
loadTemplate ($name) | |
Load a Mustache Template by name. | |
removeHelper ($name) | |
Remove a helper by name. | |
render ($template, $context=array()) | |
Shortcut 'render' invocation. | |
setCache (Mustache_Cache $cache) | |
Set the Mustache Cache instance. | |
setCompiler (Mustache_Compiler $compiler) | |
Set the Mustache Compiler instance. | |
setHelpers ($helpers) | |
Set an array of Mustache helpers. | |
setLoader (Mustache_Loader $loader) | |
Set the Mustache template Loader instance. | |
setLogger ($logger=null) | |
Set the Mustache Logger instance. | |
setParser (Mustache_Parser $parser) | |
Set the Mustache Parser instance. | |
setPartials (array $partials=array()) | |
Set partials for the current partials Loader instance. | |
setPartialsLoader (Mustache_Loader $partialsLoader) | |
Set the Mustache partials Loader instance. | |
setTokenizer (Mustache_Tokenizer $tokenizer) | |
Set the Mustache Tokenizer instance. | |
Public Attributes | |
const | PRAGMA_ANCHORED_DOT = 'ANCHORED-DOT' |
const | PRAGMA_BLOCKS = 'BLOCKS' |
const | PRAGMA_FILTERS = 'FILTERS' |
const | SPEC_VERSION = '1.2.2' |
const | VERSION = '2.14.2' |
Protected Member Functions | |
getLambdaCache () | |
Get the current Lambda Cache instance. | |
Custom Moodle engine for mustache.
core\output\mustache_engine::__construct | ( | array | $options = [] | ) |
Mustache engine constructor.
This provides an additional option to the parent Mustache_Engine implementation: $options = [ // A list of helpers (by name) to prevent from executing within the rendering // of other helpers. 'disallowednestedhelpers' => ['js'] ];
array | $options | [description] |
Reimplemented from Mustache_Engine.
|
inherited |
|
inherited |
Get the current Mustache Cache instance.
If no Cache instance has been explicitly specified, this method will instantiate and return a new one.
Mustache_Cache |
|
inherited |
Get the current Mustache character set.
string |
|
inherited |
Get the current Mustache Compiler instance.
If no Compiler instance has been explicitly specified, this method will instantiate and return a new one.
Mustache_Compiler |
|
inherited |
Get the current Mustache entitity type to escape.
int |
|
inherited |
Get the current Mustache escape callback.
callable|null |
|
inherited |
Get a Mustache helper by name.
string | $name |
mixed | Helper |
core\output\mustache_engine::getHelpers | ( | ) |
Get the current set of Mustache helpers.
Mustache_HelperCollection |
Reimplemented from Mustache_Engine.
|
protectedinherited |
Get the current Lambda Cache instance.
If 'cache_lambda_templates' is enabled, this is the default cache instance. Otherwise, it is a NoopCache.
Mustache_Cache |
|
inherited |
Get the current Mustache template Loader instance.
If no Loader instance has been explicitly specified, this method will instantiate and return a StringLoader instance.
Mustache_Loader |
|
inherited |
Get the current Mustache Logger instance.
Mustache_Logger|Psr\Log\LoggerInterface |
|
inherited |
Get the current Mustache Parser instance.
If no Parser instance has been explicitly specified, this method will instantiate and return a new one.
Mustache_Parser |
|
inherited |
Get the current Mustache partials Loader instance.
If no Loader instance has been explicitly specified, this method will instantiate and return an ArrayLoader instance.
Mustache_Loader |
|
inherited |
Get the current globally enabled pragmas.
array |
|
inherited |
Helper method to generate a Mustache template class.
This method must be updated any time options are added which make it so the same template could be parsed and compiled multiple different ways.
string | Mustache_Source | $source |
string | Mustache Template class name |
|
inherited |
Get the current Mustache Tokenizer instance.
If no Tokenizer instance has been explicitly specified, this method will instantiate and return a new one.
Mustache_Tokenizer |
|
inherited |
Check whether this Mustache instance has a helper.
string | $name |
bool | True if the helper is present |
|
inherited |
Load a Mustache lambda Template by source.
This is a helper method used by Template instances to generate subtemplates for Lambda sections. You can most likely ignore it completely.
string | $source | |
string | $delims | (default: null) |
Mustache_Template |
|
inherited |
Load a Mustache partial Template by name.
This is a helper method used internally by Template instances for loading partial templates. You can most likely ignore it completely.
string | $name |
Mustache_Template |
|
inherited |
|
inherited |
|
inherited |
Shortcut 'render' invocation.
Equivalent to calling $mustache->loadTemplate($template)->render($context);
string | $template | |
mixed | $context | (default: array()) |
string | Rendered template |
|
inherited |
Set the Mustache Cache instance.
Mustache_Cache | $cache |
|
inherited |
Set the Mustache Compiler instance.
Mustache_Compiler | $compiler |
|
inherited |
Set an array of Mustache helpers.
An array of 'helpers'. Helpers can be global variables or objects, closures (e.g. for higher order sections), or any other valid Mustache context value. They will be prepended to the context stack, so they will be available in any template loaded by this Mustache instance.
Mustache_Exception_InvalidArgumentException | if $helpers is not an array or Traversable |
array | Traversable | $helpers |
|
inherited |
Set the Mustache template Loader instance.
Mustache_Loader | $loader |
|
inherited |
Set the Mustache Logger instance.
Mustache_Exception_InvalidArgumentException | If logger is not an instance of Mustache_Logger or Psr\Log\LoggerInterface |
Mustache_Logger | Psr\Log\LoggerInterface | $logger |
|
inherited |
Set the Mustache Parser instance.
Mustache_Parser | $parser |
|
inherited |
Set partials for the current partials Loader instance.
Mustache_Exception_RuntimeException | If the current Loader instance is immutable |
array | $partials | (default: array()) |
|
inherited |
Set the Mustache partials Loader instance.
Mustache_Loader | $partialsLoader |
|
inherited |
Set the Mustache Tokenizer instance.
Mustache_Tokenizer | $tokenizer |