Open ngrinberg opened 3 years ago
Yes, It is possible.
public static Object partialHelper(String partialPath, Options options) throws IOException {
Template t = //get Template via loader using partialPath
return new Handlebars.SafeString(t.apply(options.context.combine(options.hash)));
}
SafeString will prevent partial from being escaped twice context.combine(options.hash) will pass hash params for use in partial
{{partialHelper '_header' title='my page'.... }}
is it possible to do what you can do in the js https://github.com/handlebars-lang/handlebars.js/issues/1057 where you are able to compile a partial in a custom helper?