Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

choose

Summary

Returns one of the parameters (pinpointed by the input parameter).

Usage

input|choose( value1 [, value2 [, ... ] ] )

Parameters

NameTypeDescriptionRequired
value1 any A variable/value of any kind. Yes.
value2 any Another variable/value of any kind. No.

Returns

One of the parameters.

Description

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.

Examples

Example 1

{0|choose( 'apples', 'bananas', 'coconuts' )}

The following output will be produced: "apples".

Example 2

{2|choose( 'apples', 'bananas', 'coconuts' )}

The following output will be produced: "coconuts".

Balazs Halasy (05/02/2004 10:39 am)

Balazs Halasy (04/05/2005 2:04 pm)


Comments

There are no comments.