API15

JApplicationHelper/getComponentName

< API15:JApplicationHelper

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

Return the name of the request component [main component]


<! 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 transcluded page call, red link never existed >

Examples

Code Examples


Advertisement