API16

API16:JObject/def

From Joomla! Documentation

Revision as of 22:37, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Sets a default value if not alreay assigned <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]<...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Sets a default value if not alreay assigned

[Edit Descripton]

Template:Description:JObject/def

Syntax

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

Defined in

libraries/joomla/base/object.php

Importing

jimport( 'joomla.base.object' );

Source Body

public function def($property, $default=null)
{
        $value = $this->get($property, $default);
        return $this->set($property, $value);
}

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

Examples

<CodeExamplesForm />