Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play framework 2.0 template parameters import

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)
like image 215
gooser Avatar asked Jun 21 '12 18:06

gooser


People also ask

What is twirl template?

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.

Which property is used to specify supported languages of the play application?

To ensure that languages are resolved correctly, specify the languages your app supports using the resConfigs property in the module-level build.

What is activator in play framework?

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.

Which component is responsible for building play framework?

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.


1 Answers

I believe it would be in your project/Build.scala file.

In your main

      templatesImport += "really.super.exteremely.long.package.name._"
like image 51
Jeff LaJoie Avatar answered Sep 18 '22 02:09

Jeff LaJoie