Actions

API16

JApplicationHelper/getComponentName

From Joomla! Documentation

< API16:JApplicationHelper
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Return the name of the request component [main component]

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />