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);
-
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.
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.
mixed
def
(string $key, [mixed $default = ''])
-
string
$key: The name of the parameter.
-
mixed
$default: An optional value for the parameter.
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.
Implementation for the JsonSerializable interface.
Allows us to pass JRegistry objects to json_encode.
object
jsonSerialize
()
Implementation of:
- JsonSerializable::jsonSerialize
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'], [array $options = array()])
-
string
$file: Path to file to load
-
string
$format: Format of the file [optional: defaults to JSON]
-
array
$options: Options used by the formatter
Load the public variables of the object into the default namespace.
boolean
loadObject
(object $object)
-
object
$object: The object holding the publics to load
Load a string into the registry
boolean
loadString
(string $data, [string $format = 'JSON'], [array $options = array()])
-
string
$data: String to load into the registry
-
string
$format: Format of the string
-
array
$options: Options used by the formatter
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
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
()