This is the old documentation center for eZ Publish 4. We are currently migrating the eZ Publish documentation to http://confluence.ez.no the eZ Publish 5 documentation platform. Documentation for the eZ Publish legacy components are still located on this site, as well as all documentation for earlier releases.

is_object

Summary

Returns TRUE if the target variable is an object.

Usage

input|is_object( target )

Parameters

NameTypeDescriptionRequired
target any The 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 an object (as opposed to simple types like integer, string, etc.). 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=3}
 
{if $my_variable|is_object()}
    It is an object.
{else}
    It is not an object.
{/if}

The following output will be produced: "It is not an object.".

Example 2

{def $my_variable='256'}
 
{if is_object( $my_variable )}
    It is an object.
{else}
    It is not an object.
{/if}

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

Example 3

{def $a=3
     $b='Mobile instrument.'}
 
{if $a|is_object( $b )}
    It is an object.
{else}
    It is not an object.
{/if}

The following output will be produced: "It is not an object.".

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

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


Comments

There are no comments.