I have the following problem:
Let's say my template parameter looks something like this:
@(variable : really.super.extremely.long.package.name.ClassName)
Is there anyway to just import that Class so that I can reduce it to something like this:
@(variable : ClassName)
A type safe template engine based on Scala Play comes with Twirl, a powerful Scala-based template engine, whose design was inspired by ASP.NET Razor. Specifically it is: compact, expressive, and fluid: it minimizes the number of characters and keystrokes required in a file, and enables a fast, fluid coding workflow.
To ensure that languages are resolved correctly, specify the languages your app supports using the resConfigs property in the module-level build.
The activator command can be used to create a new Play application. Activator allows you to select a template that your new application should be based off. For vanilla Play projects, the names of these templates are play-scala for Scala based Play applications, and play-java for Java based Play applications.
Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java.
I believe it would be in your project/Build.scala file.
In your main
templatesImport += "really.super.exteremely.long.package.name._"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With