cond( cond1, value1 [, cond2, value2 [, ... ] ] )
Name | Type | Description | Required |
---|---|---|---|
cond1 | boolean | Match condition 1. | Yes. |
value1 | any | Return value for condition 1. | Yes. |
cond2 | boolean | Match condition 2. | No. |
value2 | any | Return value for condition 2. | No. |
This operator evaluates the provided conditions (odd numbered parameters). If one of the conditions evaluates to TRUE then the value which is associated with that condition is returned. If none of the conditions are TRUE, the operator will return FALSE. If an odd number of parameters are provided, the operator will return the last parameter if all conditions fail.
{cond( true(), 'apples', true(), 'bananas' )}
The following output will be produced: "apples".
{cond( false(), 'apples', true(), 'bananas' )}
The following output will be produced: "bananas".
{cond( false(), 'apples', false(), 'bananas' )}
No output will be produced, the operator will return FALSE.
{cond( false(), 'apples', 'bananas' )}
The following output will be produced: "bananas".
Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.