API16

JParameter/setXML: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 4: Line 4:




{{subst:Description:JParameter/setXML}}
 


===Syntax===
===Syntax===
Line 44: Line 44:




{{subst:SeeAlso:JParameter/setXML}}
 


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=setXML
  category=setXML
  category=JParameter
  category=JParameter
  category=CodeExample
  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