first_set

Summary

Returns the first parameter that is set (or FALSE).

Usage

first_set( value1 [, value2 [, ... ] ] )

Parameters

NameTypeDescriptionRequired
value1 any A variable/value that should be evaluated. Yes.
value2 any Another variable/value that should be evaluated. No.

Returns

The first value that is set or FALSE.

Description

This operator evaluates all parameters until one of them is found to be set. The parameter that is found to be set will be returned. If none of the parameters are set, the operator will return FALSE.

Examples

Example 1

{if first_set( $a, $b, $c )}
    The truth is out there.
{else}
    The day the earth stood still.
{/if}

As long as $a, $b and $c are undeclared/unset, the following output will be produced: "The day the earth stood still".

Example 2

{first_set( $a, 256, $b )}

As long as $a is undeclared/unset, the following output will be produced: "256".

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.