Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 841 Bytes

views.md

File metadata and controls

42 lines (26 loc) · 841 Bytes

Views

View is a logical unit for combining data with form of presentation.

Rendering contents

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

Template engines

Supported template engines are:

Template engine is being determined by resource URI extension.

Pebble

Handles *.peb extension.

TODO Describe how to implement Pebble extensions

Handlebars

Handles *.hbs extension.

TODO Describe how to implement Pebble extensions