Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

(no description)

File Size: 39 lines (1 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Mustache_Loader_StringLoader:: (1 method):
  load()


Class: Mustache_Loader_StringLoader  - X-Ref

Mustache Template string Loader implementation.

A StringLoader instance is essentially a noop. It simply passes the 'name' argument straight through:

$loader = new StringLoader;
$tpl = $loader->load('{{ foo }}'); // '{{ foo }}'

This is the default Template Loader instance used by Mustache:

$m = new Mustache;
$tpl = $m->loadTemplate('{{ foo }}');
echo $tpl->render(array('foo' => 'bar')); // "bar"
load($name)   X-Ref
Load a Template by source.

param: string $name Mustache Template source
return: string Mustache Template source