Table of Contents

set

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Base Class JObject Method set Reference set() Never Work in Progress

This function sets the value of an object’s property.

Syntax

void set ( $property, $value )

$property string is a string containing the name of the property to set.
$value mixed is a variable containing the value to assign to the property.

See also: * JObject::get * JObject::setProperties * JObject::getProperties

Examples

This example uses the JBrowser class, which is a subclass of JObject.

Example

global $mainframe;

$browser = &$mainframe->getBrowser();
$browser->set( '_mobile', false );

echo "Mobile: ";
echo ($browser->get( '_mobile' )) ? "true" : "false";

Might produce:

Result

Mobile: false