From 0fcbb6b1d7541016c138df4cdfc0872a69faa6ee Mon Sep 17 00:00:00 2001 From: boots Date: Thu, 11 Dec 2003 01:58:04 +0000 Subject: [PATCH] Updated language.function.if to describe qualifiers (thanks andre) --- docs/designers.sgml | 120 +++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 63 deletions(-) diff --git a/docs/designers.sgml b/docs/designers.sgml index 996ca0ae..a019f104 100644 --- a/docs/designers.sgml +++ b/docs/designers.sgml @@ -2448,25 +2448,32 @@ index.tpl if,elseif,else - if statements in Smarty have much the same flexibility as php if + {if} statements in Smarty have much the same flexibility as PHP if statements, with a few added features for the template engine. Every {if} must be paired with an {/if}. {else} and - {elseif} are also permitted. The following lists - the recognized conditional qualifiers, which must be separated from - surrounding elements by spaces. + {elseif} are also permitted. All PHP conditionals + are recognized, such as ||, or, + &&, and, etc. + + + + The following is a list of recognized qualifiers, which must be + separated from surrounding elements by spaces. Note that items listed + in [brackets] are optional. PHP equivalents are shown where applicable. + - + - qualifier - Alternatives - Common Name + Qualifier + Alternates + Syntax Example Meaning @@ -2474,96 +2481,83 @@ index.tpl == eq - equals - same as PHP == + $a eq $b + equals (PHP: ==) != ne, neq - not equals - same as PHP != + $a neq $b + not equals (PHP: !=) > gt - greater than - same as PHP > + $a gt $b + greater than (PHP: >) < lt - less than - same as PHP < + $a lt $b + less than (PHP: <) >= gte, ge - greater than or equal - same as PHP >= + $a ge $b + greater than or equal (PHP: >=) <= lte, le - less than or equal - same as PHP <= - - - is even -   - even number - compared value is an even number - - - is not even -   - not an even number - compared value is not an even number - - - is odd -   - odd number - compared value is an odd number - - - is not odd -   - not an odd number - compared value is an not an odd number + $a le $b + less than or equal (PHP: <=) + ! not -   - unary-negation - same as PHP ! + not $a + negation (unary) (PHP: !) % mod - modulous - same as PHP % + $a mod $b + modulous (PHP: %) - div by + is [not] div by   - divisible by - same as PHP $a % $b == 0 + $a is not div by 4 + divisible by (PHP: $a % $b == 0) - even by -   -   - division results in an even number + is [not] even +   + $a is not even + [not] an even number (unary) - odd by -   -   - division results in an odd number + is [not] even by +   + $a is not even by $b + [not] an even grouping - - - + + is [not] odd +   + $a is not odd + [not] an odd number (unary) + + + is [not] odd by +   + $a is not odd by $b + [not] an odd grouping + + + if statements