grumpydev / SuperSimpleViewEngine

Super simple regex based view engine used in Nancy diagnostics and (soon to be) TinyTemplates.
36 stars 9 forks source link

Added support for conditionals inside iterators #3

Open thecopy opened 11 years ago

thecopy commented 11 years ago
@If.HasUsers
Yay Users! 
@EndIf
@Each.Users
    @Current.Name says: 
    @If.IsFromGreece
        <b>Yay Greece!</b>
    @EndIf
    @IfNot.IsFromGreece
        <b>Boo Greece!</b>
    @EndIf
@EndEach

Result:

Yay Users!
Bob says:<b>Yay Greece!</b>
Malin says:<b>Boo Greece!</b>