API16

JParameter/loadSetupFile: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Loads an xml setup file and parses it. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<n...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
Loads an xml setup file and parses it.
Loads an xml setup file and parses it.


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


{{Description:JParameter/loadSetupFile}}
 
 


===Syntax===
===Syntax===
Line 55: Line 53:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JParameter/loadSetupFile|Edit See Also]]<nowiki>]</nowiki>
 
</span>
{{SeeAlso:JParameter/loadSetupFile}}


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

Loads an xml setup file and parses it.



Syntax

loadSetupFile($path)
Parameter Name Default Value Description
$path path to xml setup file.

Returns

object

Defined in

libraries/joomla/html/parameter.php

Importing

jimport( 'joomla.html.parameter' );

Source Body

public function loadSetupFile($path)
{
        $result = false;

        if ($path) {
                $xml = &JFactory::getXMLParser('Simple');

                if ($xml->loadFile($path)) {
                        if ($params = &$xml->document->params) {
                                foreach ($params as $param) {
                                        $this->setXML($param);
                                        $result = true;
                                }
                        }
                }
        } else {
                $result = true;
        }

        return $result;
}



Examples

Code Examples