JApplicationHelper/getComponentName
From Joomla! Documentation
< API16:JApplicationHelper
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]
Return the name of the request component [main component]
<! removed transcluded page call, red link never existed >
Syntax[edit]
static getComponentName($default=NULL)
Parameter Name | Default Value | Description |
---|---|---|
$default | NULL | $default The default option |
Returns[edit]
string Option
Defined in[edit]
libraries/joomla/application/helper.php
Importing[edit]
jimport( 'joomla.application.helper' );
Source Body[edit]
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[edit]
Code Examples[edit]