JParameter/setXML: Difference between revisions
From Joomla! Documentation
No edit summary |
m preparing for archive only |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
Sets the XML object from custom xml files. | Sets the XML object from custom xml files. | ||
===Syntax=== | ===Syntax=== | ||
| Line 45: | Line 43: | ||
</source> | </source> | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=setXML | category=setXML | ||
category=JParameter | category=JParameter | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 01:58, 25 March 2017
Description
Sets the XML object from custom xml files.
Syntax
setXML(&$xml)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$xml | An XML object. |
Defined in
libraries/joomla/html/parameter.php
Importing
jimport( 'joomla.html.parameter' );
Source Body
public function setXML(&$xml)
{
if (is_object($xml)) {
if ($group = $xml->attributes('group')) {
$this->_xml[$group] = $xml;
} else {
$this->_xml['_default'] = $xml;
}
if ($dir = $xml->attributes('addpath')) {
$this->addElementPath(JPATH_ROOT . str_replace('/', DS, $dir));
}
}
}
Examples
Code Examples