API15:JInstaller/getParams
From Joomla! Documentation
Description
Method to parse the parameters of an extension, build the INI string for it's default parameters, and return the INI string.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
getParams()
Returns
string INI string of parameter values
Defined in
libraries/joomla/installer/installer.php
Importing
jimport( 'joomla.installer.installer' );
Source Body
function getParams()
{
// Get the manifest document root element
$root = & $this->_manifest->document;
// Get the element of the tag names
$element =& $root->getElementByPath('params');
if (!is_a($element, 'JSimpleXMLElement') || !count($element->children())) {
// Either the tag does not exist or has no children therefore we return zero files processed.
return null;
}
// Get the array of parameter nodes to process
$params = $element->children();
if (count($params) == 0) {
// No params to process
return null;
}
// Process each parameter in the $params array.
$ini = null;
foreach ($params as $param) {
if (!$name = $param->attributes('name')) {
continue;
}
if (!$value = $param->attributes('default')) {
continue;
}
$ini .= $name."=".$value."\n";
}
return $ini;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples