ez.no / exponential / documentation / development / libraries / ez template / operators / logical handling
These documentation pages are no longer maintained. Please visit the new documentation site.
From eztemplatelogicoperator.php:
Returns true if one or more of the input parameters does not match. Matching is casual meaning that an integer of value 0 will match a boolean of type false.
Returns true if the input value is less than the first parameter. E.g.
{1|lt(2)}
returns true.
Returns true if the input value is greater than the first parameter. E.g.
{2|gt(1)}
returns true.
Returns true if the input value is less than or equal to the first parameter. E.g.
{1|le(1)}
and
{1|le(2)}
returns true.
Returns true if the input value is greater than or equal to the first parameter. E.g.
{1|ge(1)}
and
{2|ge(1)}
returns true.
Returns true if the input value is equal to the first parameter, or if no input value is available it returns true if all parameters are equal. E.g.
{1|eq(1)}
returns true.
{eq(1,true(),false()|not,0|inc)}
returns true.
Returns true if the input value is null, which is not the same as 0. E.g.
{0|null()}
returns false.
Returns true if the input value is false. E.g.
{false()|not()}
returns true.
Creates a true boolean. Remember to use brackets, e.g.
{true()}
Creates a false boolean. Remember to use brackets, e.g.
{false()}
Evaluates all parameter values until one is found to be true, then returns that value.
The remaining parameters are not evaluated at all.
If there are no parameters or all elements were false it returns false. E.g.
{or(false(),false(),true(),false())}
returns true.
Evaluates all parameter values until one is found to be false, then returns that value.
The remaining parameters are not evaluated at all. If there are no parameters it returns false,
if no elements were false it returns the last parameter value. E.g.
{and(false(),false(),true(),false())}
returns false.
Uses the input count to pick one of the parameter elements. The input count equals the parameter index. E.g.
{0|choose("a","b","c")} returns "a".
Returns true if the first parameter value is found in the input value, which must be an array.
Currently it works the same way as the PHP function in_array() but it
may later be extended to support more advanced matching. E.g.
$array|contains($myvalue)
Comments
'contains' does indeed take strings as parameters
Mindshare Interactive Campaigns
Wednesday 01 June 2005 3:01:52 am
{set myvar='thisisastring'|contains('isastr')}
and $myvar will == true