Recently I use stringtemplate,I noticed StringTemplate can't support complex conditional,similar value>1 or value="menu" etc. who can give me a advise how to work?thanks.
Asked
Active
Viewed 761 times
1 Answers
3
StringTemplate deliberately doesn't support complex conditionals. The thinking is that if you need that much logic, you're breaking its strict enforcement of model-view separation. Instead, use a template variable that represents the complex condition you're trying to represent, and pass that in instead, or use a method that computes the correct result.

John Feminella
- 303,634
- 46
- 339
- 357