and( value1 [, value2 [, ... ] ] )
Name | Type | Description | Required |
---|---|---|---|
value1 | any | A variable/value to be evaluated. | Yes. |
value2 | any | Another variable/value to be evaluated. | No. |
This operator evaluates all parameters until one of them is found to be FALSE. The operator will then return that parameter and thus stop evaluating the rest of the parameters. If none of the parameters are found to be FALSE, the operator will return TRUE. The following table shows how the different types are evaluated by this operator.
Type | Evaluation |
---|---|
Number |
TRUE if the value is non-zero, FALSE otherwise. |
String |
TRUE if the string consists of at least one character, FALSE otherwise. |
Boolean |
TRUE if the boolean is a TRUE value, FALSE is otherwise. |
Array |
TRUE if the array has one or more elements, FALSE otherwise. |
Object |
TRUE if the object provides the "attributes" and the "attribute" methods, FALSE otherwise. |
NULL |
Always FALSE. |
Other |
Other types will be evaluated in the same way as PHP would do. |
{if and( false(), true(), false() )} The truth is out there. {else} The day the earth stood still. {/if}
The following output will be produced: "The day the earth stood still.".
{def $a=array() $b=array( 1, 2, 3 ) $c=array( 4, 5, 6 )} {and( $a, $b, $c )}
The code above will return the empty array that is represented by $a.
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.