input|choose( value1 [, value2 [, ... ] ] )
| Name | Type | Description | Required |
|---|---|---|---|
| value1 | any | A variable/value of any kind. | Yes. |
| value2 | any | Another variable/value of any kind. | No. |
This operator returns one of the parameters. The input parameter must be an integer that pinpoints exactly which parameter that should be returned. If the input parameter is zero, the operator will return the first parameter. If the input parameter is one, the operator will return the second parameter, and so on. If the offset is wrong, the operator will return FALSE.
{0|choose( 'apples', 'bananas', 'coconuts' )}
The following output will be produced: "apples".
{2|choose( 'apples', 'bananas', 'coconuts' )}
The following output will be produced: "coconuts".
This document is based on eZ Publish Documentation. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License.