JApplicationHelper/getComponentName: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Return the name of the request component [main component]
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JApplicationHelper/getCom... |
m preparing for archive only |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
Return the name of the request component [main component] | Return the name of the request component [main component] | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 51: | Line 49: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | |||
< | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=getComponentName | category=getComponentName | ||
category=JApplicationHelper | category=JApplicationHelper | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API15]] | |||
Latest revision as of 00:17, 25 March 2017
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