API16

API16:JParameter/loadSetupFile

From Joomla! Documentation

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