koajs / koa-hbs

Handlebars templates for Koa.js
MIT License
160 stars 43 forks source link

Route Specific Helpers #68

Closed nahtnam closed 7 years ago

nahtnam commented 7 years ago

Hey,

Im in the middle of writing a framework where I want to define route specific helpers. I.e if I am on / then the helper parse will do something, and if I'm in the route /test, then use a different helperparse does something else. My proposal is to add something like this:

this.render('foo', {
  layout: 'bar',
  helpers: {
    lowercase: function(word) {
      return word.toUpperCase();
    }
  }
});
nahtnam commented 7 years ago

Actually, this is not needed. I can work around it.