API15

JParameter/loadSetupFile: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
Line 66: Line 66:


===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=*

Latest revision as of 01:01, 25 March 2017

Description

Loads an xml setup file and parses it

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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

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;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples