Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Allow to extend mustache #109

jcubic opened this Issue · 0 comments

1 participant


Maybe it's good idea to allow extension of mustache wihout modifing library or Mustache class so user can put {{@foo}} or {{%foo}} and those will execute user defined function

$mustache = Mustache_Engine(array(
    'modifiers' => array(
       '%' => function($tag) {
            return file_get_contents($tag);


$mustache = Mustache_Engine(array(
    'tags_extension' => function($modifier, $tag_name, $leading, $trailing) {
        switch($modifier) {
            case '%':  return file_get_contents($tag_name);

and user will be able to put

      <h1>My robots.txt</h1>

and those modifiers will be check in _renderTag method after all of tags or before so they can be overwriten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.