开发者

StringTemplate conditional statement can't support similar id>0?

开发者 https://www.devze.com 2023-01-03 18:24 出处:网络
Recently I use stringtemplate,I noticed StringTemplate can\'t support complex conditional,similar value>1 or value=\"menu\"开发者_StackOverflow etc.

Recently I use stringtemplate,I noticed StringTemplate can't support complex conditional,similar value>1 or value="menu"开发者_StackOverflow etc. who can give me a advise how to work?thanks.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消