spray / twirl

The Play framework Scala template engine, stand-alone and packaged as an SBT plugin
Apache License 2.0
215 stars 20 forks source link

Playframework Twirl #22

Closed pedrofurla closed 10 years ago

pedrofurla commented 10 years ago

Given that https://github.com/playframework/twirl seems to be actively developed it would be nice to point to it from wiki page.

jrudolph commented 10 years ago

Thanks, good point, fixed.

pedrofurla commented 10 years ago

Oh, I am the one thanking you! That was fast! Thanks a lot! :)

maspwr commented 10 years ago

It doesn't appear as though the playframework version is usable yet. I get these compilation errors when adding it to a project:

[error] bad symbolic reference to twirl.api encountered in class file 'TwirlSupport.class'.
[error] Cannot access term api in value twirl. The current classpath may be
[error] missing a definition for twirl.api, or TwirlSupport.class may have been compiled against a version that's
[error] incompatible with the one found on the current classpath.
pedrofurla commented 10 years ago

@maspwr It worked for me with Scala 2.10.3.

maspwr commented 10 years ago

@pedrofurla I was trying with Scala 2.11.1. But I'm surprised because TwirlSupport imports from twirl.api and the playframework codebase is namespaced under play.twirl.api. How does that work?

jrudolph commented 10 years ago

Ah, I see. Yes, that's an issue. I created spray/spray#887 to track/fix that issue. As a workaround you can create a local copy of the PlayTwirlSupport class (see that ticket) and use that instead of TwirlSupport.

pedrofurla commented 10 years ago

I am a bit confused, is that about mixing both projects? In my case I completely changed to Play Twirl, my only issue was lack of docs: https://github.com/playframework/twirl/issues/28

maspwr commented 10 years ago

@jrudolph Thanks so much!

@pedrofurla Not mixing Play Twirl and Spray Twirl, but mixing Play Twirl with Spray. Specifically trying to use Play Twirl in Spray Routing (http://spray.io/documentation/1.2.1/spray-httpx/twirl-support/).