Open jcubic opened 11 years ago
What's wrong / missing with higher-order sections? https://github.com/bobthecow/mustache.php/wiki/Magic-Methods#__invoke You could pass such callbacks to the Mustache renderer as data array. Another option is defining reusable components as partials, and could then be included like {{>robots.txt}}
@mxhCodes sorry it was 9 years ago when the issue was created. I don't have the use case for the requirement. No one replied for 9 years, so I think that the project is dead.
I think it was for this project Aiki Framework, where I needed my own markup DSL.
Ha! Sorry. It's not dead, I just missed this issue somehow when it was opened 😞
In general the mustache-y answer for this sort of thing would be higher order sections, filters, or a smarter view model.
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 functionor
and user will be able to put
and those modifiers will be check in _renderTag method after all of tags or before so they can be overwriten.