jknack / handlebars.java

Logic-less and semantic Mustache templates with Java
http://jknack.github.io/handlebars.java
Other
1.48k stars 383 forks source link

Helpers namespace #525

Closed titusgahissy closed 8 years ago

titusgahissy commented 8 years ago

I'd like to fork the project to be able to add namespace to helpers and do something like :

 {{{nav.render 'main' }}

What'd be the steps to implement this feature ? Can you point me to the code to update ? Thank you.

jknack commented 8 years ago

nav.render is a valid helper name, just need to register a helper with that name:

Handlebars hbs = ...
hbs.registerHelper("nav.render", new Helper() {
 ...
});
titusgahissy commented 8 years ago

My bad. Thank you !

jknack commented 8 years ago

No problem.

Invite you to try http://jooby.org