JParameter/ construct: Difference between revisions
From Joomla! Documentation
Datashuttle (talk | contribs) m →Syntax |
m clean up |
||
| Line 2: | Line 2: | ||
Constructor | Constructor | ||
{{Description:JParameter/__construct}} | |||
{{subst:Description:JParameter/__construct}} | |||
===Syntax=== | ===Syntax=== | ||
| Line 56: | Line 54: | ||
</source> | </source> | ||
{{subst:SeeAlso:JParameter/__construct}} | |||
{{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 />