JParameter
Extends \JRegistryParameter handler
package |
Joomla.Platform |
---|---|
subpackage |
Parameter |
since |
11.1 |
deprecated |
12.1 Use JForm instead |
Methods
__clone
Magic function to clone the registry object.
__clone() : \JRegistry
__construct
Constructor
__construct(mixed $data = null)
since |
11.1 |
---|
Arguments
- $data
mixed
The data to bind to the new JRegistry object.
__toString
Magic function to render this object as a string using default args of toString method.
__toString() : string
since |
11.1 |
---|
Response
string
addElementPath
Add a directory where JParameter should search for element types.
addElementPath(mixed $path) : void
You may either pass a string or an array of directories.
JParameter will be searching for a element type in the same order you added them. If the parameter type cannot be found in the custom folders, it will look in JParameter/types.
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $path
mixed
Directory (string) or directories (array) to search.
asArray
Method to recursively convert an object of data to an array.
asArray(object $data) : array
since |
11.1 |
---|
Arguments
- $data
object
An object of data to return as an array.
Response
array
Array representation of the input object.
bind
Bind data to the parameter.
bind(mixed $data, string $group = '_default') : boolean
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $data
mixed
An array or object.- $group
string
An optional group that the data should bind to. The default group is used if not supplied.
Response
boolean
True if the data was successfully bound, false otherwise.
bindData
Method to recursively bind data to a parent object.
bindData( &$parent, mixed $data) : void
since |
11.1 |
---|
Arguments
- $parent
- $data
mixed
An array or object of data to bind to the parent object.
def
Sets a default value if not already assigned.
def(string $key, string $default = '') : string
since |
11.1 |
---|
Arguments
- $key
string
The name of the parameter.- $default
string
An optional value for the parameter.
Response
string
The value set, or the default if the value was not previously set (or null).
exists
Check if a registry path exists.
exists(string $path) : boolean
since |
11.1 |
---|
Arguments
- $path
string
Registry path (e.g. joomla.content.showauthor)
Response
boolean
get
Get a registry value.
get(string $path, mixed $default = null) : mixed
since |
11.1 |
---|
Arguments
- $path
string
Registry path (e.g. joomla.content.showauthor)- $default
mixed
Optional default value, returned if the internal value is null.
Response
mixed
Value of entry or null
getGroups
Get the number of params in each group.
getGroups() : array
deprecated |
12.1 |
---|---|
since |
11.1 |
Response
array
Array of all group names as key and parameters count as value.
getInstance
Returns a reference to a global JRegistry object, only creating it if it doesn't already exist.
getInstance(string $id) : object
This method must be invoked as:
$registry = JRegistry::getInstance($id);
since |
11.1 |
---|
Arguments
- $id
string
An ID for the registry instance
Response
object
The JRegistry object.
getNameSpaces
Get the list of namespaces
getNameSpaces() : array
deprecated |
12.1 |
---|---|
note |
Namespaces are no longer supported. |
since |
11.1 |
Response
array
List of namespaces
getNumParams
Return the number of parameters in a group.
getNumParams(string $group = '_default') : mixed
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $group
string
An optional group. The default group is used if not supplied.
Response
mixed
False if no params exist or integer number of parameters that exist.
getParam
Render a parameter type.
getParam( &$node, string $control_name = 'params', string $group = '_default') : array
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $node
- $control_name
string
An optional name of the HTML form control. The default is 'params' if not supplied.- $group
string
An optional group to render. The default group is used if not supplied.
Response
array
Any array of the label, the form element and the tooltip.
getParams
Render all parameters.
getParams(string $name = 'params', string $group = '_default') : array
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $name
string
An optional name of the HTML form control. The default is 'params' if not supplied.- $group
string
An optional group to render. The default group is used if not supplied.
Response
array
An array of all parameters, each as array of the label, the form element and the tooltip.
getValue
Get a registry value
getValue(string $path, mixed $default = null) : mixed
deprecated |
12.1 |
---|---|
note |
Use get instead. |
since |
11.1 |
Arguments
- $path
string
Registry path (e.g. joomla.content.showauthor)- $default
mixed
Optional default value
Response
mixed
Value of entry or null
loadArray
Load a associative array of values into the default namespace
loadArray(array $array) : boolean
since |
11.1 |
---|
Arguments
- $array
array
Associative array of value to load
Response
boolean
True on success
loadElement
Loads an element type.
loadElement(string $type, boolean $new = false) : object
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $type
string
The element type.- $new
boolean
False (default) to reuse parameter elements; true to load the parameter element type again.
Response
object
loadFile
Load the contents of a file into the registry
loadFile(string $file, string $format = 'JSON', mixed $options = array()) : boolean
since |
11.1 |
---|
Arguments
- $file
string
Path to file to load- $format
string
Format of the file [optional: defaults to JSON]- $options
mixed
Options used by the formatter
Response
boolean
True on success
loadINI
Load an INI string into the registry into the given namespace [or default if a namespace is not given]
loadINI(string $data, string $namespace = null, mixed $options = array()) : boolean
since |
11.1 |
---|---|
deprecated |
12.1 Use loadString passing INI as the format instead. |
Arguments
- $data
string
INI formatted string to load into the registry- $namespace
string
Namespace to load the INI string into [optional]- $options
mixed
An array of options for the formatter, or boolean to process sections.
Response
boolean
True on success
loadJSON
Load an JSON string into the registry into the given namespace [or default if a namespace is not given]
loadJSON(string $data) : boolean
deprecated |
12.1 Use loadString passing JSON as the format instead. |
---|---|
note |
Use loadString instead. |
since |
11.1 |
Arguments
- $data
string
JSON formatted string to load into the registry
Response
boolean
True on success
loadObject
Load the public variables of the object into the default namespace.
loadObject(object $object) : boolean
since |
11.1 |
---|
Arguments
- $object
object
The object holding the publics to load
Response
boolean
True on success
loadSetupFile
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.
loadSetupFile() : boolean
deprecated |
12.1 |
---|---|
note |
Load no longer supported. |
since |
11.1 |
Response
boolean
True.
loadString
Load a string into the registry
loadString(string $data, string $format = 'JSON', mixed $options = array()) : boolean
since |
11.1 |
---|
Arguments
- $data
string
String to load into the registry- $format
string
Format of the string- $options
mixed
Options used by the formatter
Response
boolean
True on success
loadXML
Load an XML string into the registry into the given namespace [or default if a namespace is not given]
loadXML(string $data, string $namespace = null) : boolean
since |
11.1 |
---|---|
deprecated |
12.1 Use loadString passing XML as the format instead. |
note |
Arguments
- $data
string
XML formatted string to load into the registry- $namespace
string
Namespace to load the XML string into [optional]
Response
boolean
True on success
makeNameSpace
Create a namespace
makeNameSpace(string $namespace) : boolean
deprecated |
12.1 |
---|---|
note |
Namespaces are no longer supported. |
since |
11.1 |
Arguments
- $namespace
string
Name of the namespace to create
Response
boolean
True on success
merge
Merge a JRegistry object into this one
merge( &$source) : boolean
since |
11.1 |
---|
Arguments
- $source
Response
boolean
True on success
render
Render the form control.
render(string $name = 'params', string $group = '_default') : string
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $name
string
An optional name of the HTML form control. The default is 'params' if not supplied.- $group
string
An optional group to render. The default group is used if not supplied.
Response
string
HTML
renderToArray
Render all parameters to an array.
renderToArray(string $name = 'params', string $group = '_default') : array
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $name
string
An optional name of the HTML form control. The default is 'params' if not supplied.- $group
string
An optional group to render. The default group is used if not supplied.
Response
array
set
Set a registry value.
set(string $path, mixed $value) : mixed
since |
11.1 |
---|
Arguments
- $path
string
Registry Path (e.g. joomla.content.showauthor)- $value
mixed
Value of entry
Response
mixed
The value of the that has been set.
setValue
Set a registry value
setValue(string $path, mixed $value) : mixed
deprecated |
12.1 |
---|---|
note |
Use set instead. |
since |
11.1 |
Arguments
- $path
string
Registry Path (e.g. joomla.content.showauthor)- $value
mixed
Value of entry
Response
mixed
The value after setting.
setXML
Sets the XML object from custom XML files.
setXML( &$xml) : void
deprecated |
12.1 |
---|---|
since |
11.1 |
Arguments
- $xml
toArray
Transforms a namespace to an array
toArray() : array
since |
11.1 |
---|
Response
array
An associative array holding the namespace data
toObject
Transforms a namespace to an object
toObject() : object
since |
11.1 |
---|
Response
object
An an object holding the namespace data
toString
Get a namespace in a given string format
toString(string $format = 'JSON', mixed $options = array()) : string
since |
11.1 |
---|
Arguments
- $format
string
Format to return the string in- $options
mixed
Parameters used by the formatter, see formatters for more info
Response
string
Namespace in string format
Properties
_raw
The raw params string
since |
11.1 |
---|
Type(s)
string
_xml
The XML params element
since |
11.1 |
---|
Type(s)
object
_elements
Loaded elements
since |
11.1 |
---|
Type(s)
array
_elementPath
Directories, where element types can be stored
since |
11.1 |
---|
Type(s)
array
data
Registry Object
since |
11.1 |
---|
Type(s)
object
instances
JRegistry instances container.
since |
11.3 |
---|
Type(s)
array