4

I am not sure how to get twirl templates to work with Intellij IDEA 14

My build.sbt:

libraryDependencies += "com.typesafe.play" % "twirl-api_2.11" % "1.1.1"

My text template:

@(date: java.util.Date)
hello world

My call to render:

  println(play.twirl.api.Txt.testTemplate.render(new Date()))

The compiler error:

Error:(26, 34) value testTemplate is not a member of object play.twirl.api.Txt
  println(play.twirl.api.Txt.testTemplate.render(new Date()))
                             ^

I read somewhere that I should compile the template outside Intellij by using:

sbt compile

I am not sure if this will work. Also, I have the plugin for sbt installed, but I don't know how to get a command line version set up on the mac.

Any advice for me?

user2302244
  • 843
  • 2
  • 11
  • 27

0 Answers0