Play Framework View Template constructs
Play Framework uses the Twirl Template engine for its View Components. We will discuss some of the important, useful, and frequently used Twirl Template engine constructs so that we don't get confused while developing Play Framework examples in the upcoming sections.
Twirl View Templates
Play Framework supports different View Templates using the Twirl Template engine. We can even create our own View Template types.
Some of the important Play View Template types are as follows:
- Scala Template:
main.scala.html
Here we use main as the template name and scala to identify this as a Scala-based HTML template type.
- Text Template:
main.scala.txt
Here we use main as the template name and txt to identify this as a Scala-based Text template type.
- XML Template:
main.scala.xml
Here we use main as the template name and scala to identify this as a Scala-based XML template type.
For instance, we have a project with play-scala-app as the base directory. Let's assume PROJECT_HOME...