API15

API15:JApplicationHelper/getComponentName

From Joomla! Documentation

Revision as of 21:52, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Return the name of the request component [main component] <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JApplicationHelper/getCom...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Return the name of the request component [main component]

[Edit Descripton]

Template:Description:JApplicationHelper/getComponentName

Syntax

static getComponentName($default=NULL)
Parameter Name Default Value Description
$default NULL $default The default option

Returns

string Option

Defined in

libraries/joomla/application/helper.php

Importing

jimport( 'joomla.application.helper' );

Source Body

public static function getComponentName($default = NULL)
{
        static $option;

        if ($option) {
                return $option;
        }

        $option = strtolower(JRequest::getCmd('option'));

        if (empty($option)) {
                $option = $default;
        }

        JRequest::setVar('option', $option);
        return $option;
}

[Edit See Also] Template:SeeAlso:JApplicationHelper/getComponentName

Examples

<CodeExamplesForm />