How to use an IF statement in a loop using StringTemplate

This does not display anything:

$ Articles: {$ If (I! = 1) $ mapping between articles $ ENDIF $ $ It.Text
        }

Displayed as expected

$ Articles: {mapping between $ It.Text articles
        }

Any ideas on how to do this?

+3
source share
2 answers

you need to calculate all the expressions and click into the template. You clearly filter what to do in the model, not in the view. Please look:

http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf

Terence

+7

, , $if . !(NOT),
, , = (i!= 1) $if.

0

Source: https://habr.com/ru/post/1720184/


All Articles