View is a logical unit for combining data with form of presentation.
To render HTML contents from a template in the controller just write above:
@Path("/adm/system")
class SystemController : Controller() {
@GET
@Path("/home")
@Produces(MediaType.TEXT_HTML)
fun getDashboard(): String {
return view("bundle://adm/view/system/dashboard.peb").render()
}
}
Supported template engines are:
Template engine is being determined by resource URI extension.
Handles *.peb extension.
TODO Describe how to implement Pebble extensions
Handles *.hbs extension.
TODO Describe how to implement Pebble extensions