hi i am working on mustache.php with codeigniter it is parsing mustache tag really nice now how can i use CI helpers or php functions with in mustache tags like
{{ anchor("http://www.google.com","Google") }}
//php function
{{ date() }}
i have tried mustache helpers but no luck as per this post github mustache
i this case i have to add extra opening and closing mustache tags. which i don’t want just passing function in tags and get output.
You cannot call functions directly in your Mustache template (logic-less templates, remember?)
Instead, this functionality belongs in your rendering context, or your ViewModel. At a minimum, this means preparing your data in advance:
An even better approach is to encapsulate all of the logic required for
my-template.mustachein a ViewModel class, lets call itMyTemplate: