API16

API16:JObject/get

From Joomla! Documentation

Revision as of 22:37, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Returns a property of the object or the default value if the property is not set. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:J...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Returns a property of the object or the default value if the property is not set.

[Edit Descripton]

Template:Description:JObject/get

Syntax

get($property, $default=null)
Parameter Name Default Value Description
$property $property The name of the property.
$default null $default The default value.

Returns

mixed The value of the property.

Defined in

libraries/joomla/base/object.php

Importing

jimport( 'joomla.base.object' );

Source Body

public function get($property, $default=null)
{
        if (isset($this->$property)) {
                return $this->$property;
        }
        return $default;
}

[Edit See Also] Template:SeeAlso:JObject/get

Examples

<CodeExamplesForm />