Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How is it possible to pass multiple params into a template in Play 2.0?
- String one = "one";
- String two = "two";
- return ok(template.render(one,two));
- @(one: String, two: String)
- This is first param: @one <br/>
- This is second param: @two
- public static Result index() {
- Map<String, String> labels = new HashMap<String, String>();
- labels.put("first", "First label");
- labels.put("second", "Second label");
- // etc etc
- labels.put("hundredth", "Label no. 100");
- return ok(template.render(labels));
- }
- @(labels: Map[String, String])
- @labels.get("first") <br/>
- @labels.get("second") <br/>
- .....
- @labels.get("hundredth")
Add Comment
Please, Sign In to add comment