API16

JParameter/ construct: Difference between revisions

From Joomla! Documentation

m clean up
Line 2: Line 2:
Constructor
Constructor


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


{{Description:JParameter/__construct}}
 
{{subst:Description:JParameter/__construct}}


===Syntax===
===Syntax===
Line 56: Line 54:
</source>
</source>


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


===Examples===
===Examples===

Revision as of 14:18, 24 March 2017

Description

Constructor


{{subst:Description:JParameter/__construct}}

Syntax

__construct($data= '', $path= '')
Parameter Name Default Value Description
$data The raw params text
$path Path to the xml setup file

Defined in

libraries/joomla/html/parameter.php

Importing

jimport( 'joomla.html.parameter' );

Source Body

public function __construct($data = '', $path = '')
{
        parent::__construct('_default');

        // Set base path.
        $this->_elementPath[] = dirname(__FILE__).DS.'parameter'.DS.'element';

        if ($data = trim($data)) {
                if (strpos($data, '{') === 0) {
                        $this->loadJSON($data);
                } else {
                        $this->loadINI($data);
                }
        }

        if ($path) {
                $this->loadSetupFile($path);
        }

        $this->_raw = $data;
}


{{subst:SeeAlso:JParameter/__construct}}

Examples

<CodeExamplesForm />