Class JParameter

Description

Parameter handler

  • deprecated: 12.1 Use JForm instead
  • since: 11.1

Located in /libraries/joomla/html/parameter.php (line 23)

JRegistry
   |
   --JParameter
Variable Summary
array $_elements
string $_raw
object The $_xml
Method Summary
JParameter __construct ([string $data = ''], [string $path = ''])
void addElementPath (mixed $path)
boolean bind (mixed $data, [string $group = '_default'])
string def (string $key, [string $default = ''], [string $group = '_default'])
array getGroups ()
mixed getNumParams ([string $group = '_default'])
array getParam (object &$node, [string $control_name = 'params'], [string $group = '_default'])
array getParams ([string $name = 'params'], [string $group = '_default'])
object loadElement (string $type, [boolean $new = false])
object loadSetupFile (string $path)
string render ([string $name = 'params'], [string $group = '_default'])
array renderToArray ([string $name = 'params'], [string $group = '_default'])
void setXML (JSimpleXMLElement &$xml)
Variables
array $_elementPath = array() (line 47)
  • var: Directories, where element types can be stored
  • since: 11.1
  • access: protected
array $_elements = array() (line 41)
  • var: Loaded elements
  • since: 11.1
  • access: protected
string $_raw = null (line 29)
  • var: The raw params string
  • since: 11.1
  • access: protected
object The $_xml = null (line 35)
  • var: XML params element
  • since: 11.1
  • access: protected

Inherited Variables

Inherited from JRegistry

JRegistry::$data
JRegistry::$instances
Methods
Constructor __construct (line 58)

Constructor

  • deprecated: 12.1
  • since: 11.1
  • access: public
JParameter __construct ([string $data = ''], [string $path = ''])
  • string $data: The raw parms text.
  • string $path: Path to the XML setup file.

Redefinition of:
JRegistry::__construct()
Constructor
addElementPath (line 490)

Add a directory where JParameter should search for element types.

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
  • access: public
void addElementPath (mixed $path)
  • mixed $path: Directory (string) or directories (array) to search.
bind (line 155)

Bind data to the parameter.

  • return: True if the data was successfully bound, false otherwise.
  • deprecated: 12.1
  • since: 11.1
  • access: public
boolean bind (mixed $data, [string $group = '_default'])
  • mixed $data: An array or object.
  • string $group: An optional group that the data should bind to. The default group is used if not supplied.
def (line 100)

Sets a default value if not alreay assigned.

  • return: The value set, or the default if the value was not previously set (or null).
  • deprecated: 12.1
  • since: 11.1
  • access: public
string def (string $key, [string $default = ''], [string $group = '_default'])
  • string $key: The name of the parameter.
  • string $default: An optional value for the parameter.
  • string $group: An optional group for the parameter.

Redefinition of:
JRegistry::def()
Sets a default value if not already assigned.
getGroups (line 290)

Get the number of params in each group.

  • return: Array of all group names as key and parameters count as value.
  • deprecated: 12.1
  • since: 11.1
  • access: public
array getGroups ()
getNumParams (line 267)

Return the number of parameters in a group.

  • return: False if no params exist or integer number of parameters that exist.
  • deprecated: 12.1
  • since: 11.1
  • access: public
mixed getNumParams ([string $group = '_default'])
  • string $group: An optional group. The default group is used if not supplied.
getParam (line 352)

Render a parameter type.

  • return: Any array of the label, the form element and the tooltip.
  • deprecated: 12.1
  • since: 11.1
  • access: public
array getParam (object &$node, [string $control_name = 'params'], [string $group = '_default'])
  • object &$node: A parameter XML element.
  • string $control_name: An optional name of the HTML form control. The default is 'params' if not supplied.
  • string $group: An optional group to render. The default group is used if not supplied.
getParams (line 320)

Render all parameters.

  • return: An array of all parameters, each as array of the label, the form element and the tooltip.
  • deprecated: 12.1
  • since: 11.1
  • access: public
array getParams ([string $name = 'params'], [string $group = '_default'])
  • string $name: An optional name of the HTML form control. The default is 'params' if not supplied.
  • string $group: An optional group to render. The default group is used if not supplied.
loadElement (line 427)

Loads an element type.

  • deprecated: 12.1
  • since: 11.1
  • access: public
object loadElement (string $type, [boolean $new = false])
  • string $type: The element type.
  • boolean $new: False (default) to reuse parameter elements; true to load the parameter element type again.
loadSetupFile (line 388)

Loads an XML setup file and parses it.

  • deprecated: 12.1
  • since: 11.1
  • access: public
object loadSetupFile (string $path)
  • string $path: A path to the XML setup file.

Redefinition of:
JRegistry::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.
render (line 186)

Render the form control.

  • return: HTML
  • deprecated: 12.1
  • since: 11.1
  • access: public
string render ([string $name = 'params'], [string $group = '_default'])
  • string $name: An optional name of the HTML form control. The default is 'params' if not supplied.
  • string $group: An optional group to render. The default group is used if not supplied.
renderToArray (line 238)

Render all parameters to an array.

  • deprecated: 12.1
  • since: 11.1
  • access: public
array renderToArray ([string $name = 'params'], [string $group = '_default'])
  • string $name: An optional name of the HTML form control. The default is 'params' if not supplied.
  • string $group: An optional group to render. The default group is used if not supplied.
setXML (line 120)

Sets the XML object from custom XML files.

  • deprecated: 12.1
  • since: 11.1
  • access: public
void setXML (JSimpleXMLElement &$xml)

Inherited Methods

Inherited From JRegistry

JRegistry::__construct()
JRegistry::asArray()
JRegistry::bindData()
JRegistry::def()
JRegistry::exists()
JRegistry::get()
JRegistry::getInstance()
JRegistry::getNameSpaces()
JRegistry::getValue()
JRegistry::loadArray()
JRegistry::loadFile()
JRegistry::loadINI()
JRegistry::loadJSON()
JRegistry::loadObject()
JRegistry::loadSetupFile()
JRegistry::loadString()
JRegistry::loadXML()
JRegistry::makeNameSpace()
JRegistry::merge()
JRegistry::set()
JRegistry::setValue()
JRegistry::toArray()
JRegistry::toObject()
JRegistry::toString()
JRegistry::__clone()
JRegistry::__toString()

Documentation generated on Mon, 25 Jun 2012 13:58:34 -0500 by phpDocumentor 1.4.4