16
votes

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)
2

2 Answers

14
votes

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

In your main

      templatesImport += "really.super.exteremely.long.package.name._"
1
votes

Just wanted to chime in and say that the above example by @Jeff LaJoie still works under Play 2.2.3

In your build.sbt

templatesImport += "really.super.exteremely.long.package.name._"

or

templatesImport ++= Seq( "really.super.exteremely.long.package.name._", "another.really.super.exteremely.long.package.name._" )