A very simple play 2.0 plugin for using scalate templates as view rendering in play 2.0.
For more information, see Scalate
Tested scalate templates :
How to use this plugin
- Clone this repository
git clone email@example.com:adetante/play2-scalate.git
- Build and publish the plugin to your local repository
cd play2-scalate/project-code play // In the play console, type : publish-local
- Add the following lines to the dependencies in your own project :
// In your project/Build.scala : val appDependencies = Seq( "play2-scalate" %% "play2-scalate" % "0.1-SNAPSHOT", "org.fusesource.scalate" % "scalate-core" % "1.5.3" )
Write templates in the
app/viewsdirectory of your application (template filenames must end with
Use the following line to render template in your controllers :
Ok(Template.render("sample.mustache",Map("varName"->"something to pass to the template")))
A sample webapp can be found in the following path :
Clone this repo,
play run in this directory and look at the samples.
Samples provide views for mustache, scaml and jade templates.
- Include Play objects (request, session, routes, …) in the scope of templates