diff options
Diffstat (limited to 'tests/00_syntax/18_if_condition')
-rw-r--r-- | tests/00_syntax/18_if_condition | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/00_syntax/18_if_condition b/tests/00_syntax/18_if_condition index 0148466..9601f11 100644 --- a/tests/00_syntax/18_if_condition +++ b/tests/00_syntax/18_if_condition @@ -40,6 +40,7 @@ This should print "one": } %} + This should print "two": {% x = 1; @@ -52,6 +53,7 @@ This should print "two": } %} + Multiple conditions can be used by chaining if/else statements: {% x = 2; @@ -70,6 +72,7 @@ Multiple conditions can be used by chaining if/else statements: } %} + If the conditional block consists of only one statement, the curly braces may be omitted: {% @@ -81,6 +84,7 @@ braces may be omitted: print("two"); %} + An if-condition using the alternative syntax: {% if (x == 1): -%} Variable x was set to one. @@ -88,6 +92,7 @@ Variable x was set to one. Variable x has another value. {% endif %} + Ternary expressions function similar to if/else statements but only allow for a single expression in the true and false branches: {% @@ -96,4 +101,5 @@ only allow for a single expression in the true and false branches: print(s); %} + -- End -- |