JObject/set: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Modifies a property of the object, creating it if it does not already exist.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JObjec... |
m clean up |
||
| Line 2: | Line 2: | ||
Modifies a property of the object, creating it if it does not already exist. | Modifies a property of the object, creating it if it does not already exist. | ||
{{Description:JObject/set}} | |||
{{subst:Description:JObject/set}} | |||
===Syntax=== | ===Syntax=== | ||
| Line 44: | Line 42: | ||
</source> | </source> | ||
{{subst:SeeAlso:JObject/set}} | |||
{{SeeAlso:JObject/set}} | |||
===Examples=== | ===Examples=== | ||
Revision as of 14:16, 24 March 2017
Description
Modifies a property of the object, creating it if it does not already exist.
{{subst:Description:JObject/set}}
Syntax
set($property, $value=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $property | $property The name of the property. | |
| $value | null | $value The value of the property to set. |
Returns
mixed Previous value of the property.
Defined in
libraries/joomla/base/object.php
Importing
jimport( 'joomla.base.object' );
Source Body
public function set($property, $value = null)
{
$previous = isset($this->$property) ? $this->$property : null;
$this->$property = $value;
return $previous;
}
{{subst:SeeAlso:JObject/set}}
Examples
<CodeExamplesForm />