koajs / koa-hbs

Handlebars templates for Koa.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Route Specific Helpers

nahtnam opened this issue · comments

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();
    }
  }
});

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