tbranyen / combyne

A template engine that works the way you expect.
MIT License
144 stars 19 forks source link

Call functions *with arguments* from within a template #39

Closed tbranyen closed 10 years ago

tbranyen commented 10 years ago

@carldanley any thoughts on the following idea:

template:

{{ obj.toUpper 'test' }}

Would then call the respective function with the passed argument:

template.render({
  toUpper: function(str) {
    return str.toUpperCase();
  }
});

I'm thinking this could be useful for Backbone models:

{{ model.get 'someAttr' }}
tbranyen commented 10 years ago

Closed via #43