API16

JParameter/setXML: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Sets the XML object from custom xml files. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowi...
 
m preparing for archive only
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
Sets the XML object from custom xml files.
Sets the XML object from custom xml files.


<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JParameter/setXML|Edit Descripton]]<nowiki>]</nowiki>
</span>


{{Description:JParameter/setXML}}
 
 


===Syntax===
===Syntax===
Line 17: Line 15:
!Description
!Description
|-
|-
|  
| &$xml
|  
|  
|  An XML object.  
|  An XML object.  
Line 45: Line 43:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JParameter/setXML|Edit See Also]]<nowiki>]</nowiki>
 
</span>
{{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