Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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