-
Notifications
You must be signed in to change notification settings - Fork 6
Create your own viewrender
joris hermans edited this page Jan 24, 2015
·
1 revision
But you can also write your own 'ForceViewRender' implementation as follow. This is not needed when you are happy with the mustacheRender engine!
class FancyRender extends ForceViewRender {
FancyRender(ServingAssistent servingAssistent, [views = "../views/", clientFiles = "../build/web/", clientServe = true]) : super(servingAssistent, views, clientFiles, clientServe);
String _render_impl(String template, model) {
// render logic of your template + model will become your output
return fancy_render(template, model);
}
}
And register your FancyRender as a component as follow:
@Config
class OwnConfig {
@Autowired
ServingAssistent servingAssistent;
@Bean
ForceViewRender viewRender() {
return new FancyRender(servingAssistent);
}
}