Skip to content

Instantly share code, notes, and snippets.

@akdubya
Created October 29, 2010 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akdubya/654570 to your computer and use it in GitHub Desktop.
Save akdubya/654570 to your computer and use it in GitHub Desktop.
{
"helper": function(chunk, context, bodies, params) {
if (typeof params.foo === "function") {
// if params.foo is a function body, render it
return params.foo(chunk, context);
}
// otherwise just echo the string
return chunk.write(params.foo);
},
"what": "pie"
}
I like pie
{#helper foo="I like {what}"/}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment