Skip to content

reuben-sutton/play2.x-scalate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

play2-scalate

About

A very simple play 2.1 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 git@github.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/views directory of your application (template filenames must end with .jade, .mustache or .scaml)

  • Use the following line to render template in your controllers :

Ok(Template.render("sample.mustache",Map("varName"->"something to pass to the template")))

Samples

A sample webapp can be found in the following path :

play2-scalate\samples\play2-scalate-sample

Clone this repo, play run in this directory and look at the samples.

Samples provide views for mustache, scaml and jade templates.

TODO

  • Include Play objects (request, session, routes, …) in the scope of templates

About

Change for compilation on Play2.10

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%