Returns a reference to a global JRegistry object, only creating it if it doesn't already exist.
This method must be invoked as:
$registry = JRegistry::getInstance($id);
static
object The
getInstance
(string $id)
-
string
$id: An ID for the registry instance
Constructor
JRegistry
__construct
([mixed $data = null])
-
mixed
$data: The data to bind to the new JRegistry object.
Redefined in descendants as:
Method to recursively convert an object of data to an array.
array
asArray
(object $data)
-
object
$data: An object of data to return as an array.
Method to recursively bind data to a parent object.
void
bindData
(object &$parent, mixed $data)
-
object
&$parent: The parent object on which to attach the data values.
-
mixed
$data: An array or object of data to bind to the parent object.
Sets a default value if not already assigned.
string
def
(string $key, [string $default = ''])
-
string
$key: The name of the parameter.
-
string
$default: An optional value for the parameter.
Redefined in descendants as:
Check if a registry path exists.
boolean
exists
(string $path)
-
string
$path: Registry path (e.g. joomla.content.showauthor)
Get a registry value.
mixed
get
(string $path, [mixed $default = null])
-
string
$path: Registry path (e.g. joomla.content.showauthor)
-
mixed
$default: Optional default value, returned if the internal value is null.
Get the list of namespaces
array
getNameSpaces
()
Get a registry value
mixed
getValue
(string $path, [mixed $default = null])
-
string
$path: Registry path (e.g. joomla.content.showauthor)
-
mixed
$default: Optional default value
Load a associative array of values into the default namespace
boolean
loadArray
(array $array)
-
array
$array: Associative array of value to load
Load the contents of a file into the registry
boolean
loadFile
(string $file, [string $format = 'JSON'], [mixed $options = array()])
-
string
$file: Path to file to load
-
string
$format: Format of the file [optional: defaults to JSON]
-
mixed
$options: Options used by the formatter
Load an INI string into the registry into the given namespace [or default if a namespace is not given]
boolean
loadINI
(string $data, [string $namespace = null], [mixed $options = array()])
-
string
$data: INI formatted string to load into the registry
-
string
$namespace: Namespace to load the INI string into [optional]
-
mixed
$options: An array of options for the formatter, or boolean to process sections.
Load an JSON string into the registry into the given namespace [or default if a namespace is not given]
boolean
loadJSON
(string $data)
-
string
$data: JSON formatted string to load into the registry
Load the public variables of the object into the default namespace.
boolean
loadObject
(object $object)
-
object
$object: The object holding the publics to load
This method is added as an interim solution for API references in the Joomla! CMS 1.6 to the JRegistry object where in 1.5 a JParameter object existed. Because many extensions may call this method we add it here as a means of "pain relief" until the 1.8 release.
boolean
loadSetupFile
()
Redefined in descendants as:
Load a string into the registry
boolean
loadString
(string $data, [string $format = 'JSON'], [mixed $options = array()])
-
string
$data: String to load into the registry
-
string
$format: Format of the string
-
mixed
$options: Options used by the formatter
Load an XML string into the registry into the given namespace [or default if a namespace is not given]
boolean
loadXML
(string $data, [string $namespace = null])
-
string
$data: XML formatted string to load into the registry
-
string
$namespace: Namespace to load the XML string into [optional]
Create a namespace
boolean
makeNameSpace
(string $namespace)
-
string
$namespace: Name of the namespace to create
Merge a JRegistry object into this one
-
JRegistry
&$source: Source JRegistry object to merge.
Set a registry value.
mixed
set
(string $path, mixed $value)
-
string
$path: Registry Path (e.g. joomla.content.showauthor)
-
mixed
$value: Value of entry
Set a registry value
mixed
setValue
(string $path, mixed $value)
-
string
$path: Registry Path (e.g. joomla.content.showauthor)
-
mixed
$value: Value of entry
Transforms a namespace to an array
array
toArray
()
Transforms a namespace to an object
object An
toObject
()
Get a namespace in a given string format
string
toString
([string $format = 'JSON'], [mixed $options = array()])
-
string
$format: Format to return the string in
-
mixed
$options: Parameters used by the formatter, see formatters for more info
Magic function to clone the registry object.
Magic function to render this object as a string using default args of toString method.
string
__toString
()