Chapter 6. Building a user interface with view templates
This chapter covers
- Introducing type-safe template engines
- Creating templates
- The template syntax
- Structuring larger templates into reusable pieces
- Internationalization support
Chances are, you’re building a web application that’s going to be used by humans. Even though the web is increasingly a place where applications talk to each other via APIs, and many web applications only exist as back ends for applications on mobile devices, it’s probably safe to say that the majority of web applications interact with humans via a web browser.
Browsers interpret HTML, and with it you can create the shiny interfaces that users expect, using your application to present the HTML front end to the user. Your Play application can generate this HTML on the server and send it to the browser, or the HTML can be generated by JavaScript on the client. A hybrid model is also possible, where parts of the page’s HTML are generated on the server, and other parts are filled with HTML generated in the browser.
This chapter will focus on generating HTML on the server, in your Play application.