From 43e406068af8f2ae3d77301926bb5d31f392c961 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 15 Oct 2013 19:24:01 +0200 Subject: Initial commit --- Mustache/Loader/StringLoader.php | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Mustache/Loader/StringLoader.php (limited to 'Mustache/Loader/StringLoader.php') diff --git a/Mustache/Loader/StringLoader.php b/Mustache/Loader/StringLoader.php new file mode 100644 index 00000000..8f18062f --- /dev/null +++ b/Mustache/Loader/StringLoader.php @@ -0,0 +1,42 @@ +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" + * + * @implements Loader + */ +class Mustache_Loader_StringLoader implements Mustache_Loader +{ + + /** + * Load a Template by source. + * + * @param string $name Mustache Template source + * + * @return string Mustache Template source + */ + public function load($name) + { + return $name; + } +} -- cgit v1.2.3-55-g7522