ibexa

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

is_boolean

Summary

Returns TRUE if the provided variable is a boolean.

Usage

input|is_boolean( target )

Parameters

NameTypeDescriptionRequired
target any Target variable. Only if the input parameter is omitted.

Returns

TRUE or FALSE.

Description

This operator checks if the input parameter or the target variable is a boolean. If it is, the operator will return TRUE, otherwise FALSE will be returned. If both the input parameter and the target variable are provided, it is the target variable that will be evaluated.

Examples

Example 1

{def $my_variable=true
{if $my_variable|is_boolean()}
    It is a boolean.
{else}
    It is not a boolean.
{/if}

The following output will be produced: "It is a boolean.".

Example 2

{def $my_variable=true
{if is_boolean( $my_variable )}
    It is a boolean.
{else}
    It is not a boolean.
{/if}

The following output will be produced: "It is a boolean.".

Example 3

{def $my_variable=true
     $your_variable='BOFID'}
{if $my_variable|is_boolean( $your_variable )}
    It is a boolean.
{else}
    It is not a boolean.
{/if}

The following output will be produced: "It is not a boolean.".

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

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


Comments

There are no comments.