Reputation: 28850
Does play framework 2.0 support nested if statement in template ?
I using the following code, but the rendered html is this ""
// template
<tr class=@if(e.error1!=""){"error"}
else if(e.statusDetail.contains("failure")){"warning"}
else{"info"} >
// generated html
<tr class=
else if(e.statusDetail.contains("failure")){"warning"}
else{"info"} >
Upvotes: 0
Views: 1407
Reputation: 461
Currently it is unsupported: https://play.lighthouseapp.com/projects/82401/tickets/783-else-if-statement-missing-in-the-scala-template
You can use pattern matching or if bolck inside else.
Upvotes: 1