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

is_set

Summary

Returns TRUE if the value of the provided variable is set.

Usage

is_set( target )

Parameters

NameTypeDescriptionRequired
target any The target variable. Yes.

Returns

TRUE or FALSE.

Description

This operator checks if the value of the target parameter is a non-false value (meaning that it is set). If it is, the operator will return TRUE, otherwise FALSE will be returned. Please note that this operator does not take an input parameter.

Examples

Example 1

{if is_set( $whatever )}
    It is set.
{else}
    It is not set.
{/if}

The following output will be produced: "It is not set." - because $whatever is not declared and/or defined.

Example 2

{def $whatever='We need more rocket fuel!'}
{if is_set( $whatever )}
    It is set.
{else}
    It is not set.
{/if}

The following output will be produced: "It is set.".

Balazs Halasy (05/02/2004 12:35 pm)

Balazs Halasy (06/05/2005 7:28 am)


Comments

There are no comments.