API16

JObject/get: Difference between revisions

From Joomla! Documentation

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...
 
m clean up
Line 2: Line 2:
Returns a property of the object or the default value if the property is not set.
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:JObject/get|Edit Descripton]]<nowiki>]</nowiki>
</span>


{{Description:JObject/get}}
 
{{subst:Description:JObject/get}}


===Syntax===
===Syntax===
Line 45: Line 43:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JObject/get|Edit See Also]]<nowiki>]</nowiki>
{{subst:SeeAlso:JObject/get}}
</span>
{{SeeAlso:JObject/get}}


===Examples===
===Examples===

Revision as of 14:16, 24 March 2017

Description

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


{{subst: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;
}


{{subst:SeeAlso:JObject/get}}

Examples

<CodeExamplesForm />