API16

JInstaller/getParams

From Joomla! Documentation

< API16:JInstaller
Revision as of 17:54, 22 March 2010 by Doxiki (talk | contribs) (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...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API16" 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.

[Edit Descripton]

Template:Description:JInstaller/getParams

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]

public function getParams()
{
        // Get the manifest document root element
        $root = & $this->manifest->document;

        // Get the element of the tag names
        $params = $this->manifest->params;
        if( ! count($params->children())) {
                // Either the tag does not exist or has no children therefore we return zero files processed.
                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;
}

[Edit See Also] Template:SeeAlso:JInstaller/getParams

Examples[edit]

<CodeExamplesForm />