API15

Difference between revisions of "JInstaller/getParams"

From Joomla! Documentation

< API15:JInstaller
(New page: ===Description=== Method to parse the parameters of an extension, build the INI string for it's default parameters, and return the INI string. <span class="editsection" style="font-size...)
 
m (removing red link to edit, no existant pages)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JInstaller/getParams|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JInstaller/getParams}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 59: Line 59:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JInstaller/getParams|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JInstaller/getParams}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 74: Line 74:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Revision as of 13:31, 12 May 2013

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

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[edit]

getParams()


Returns[edit]

string INI string of parameter values

Defined in[edit]

libraries/joomla/installer/installer.php

Importing[edit]

jimport( 'joomla.installer.installer' );

Source Body[edit]

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[edit]

<CodeExamplesForm />