JComponentHelper/isEnabled: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Checks if the component is enabled
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<now... |
No edit summary |
||
| Line 9: | Line 9: | ||
===Syntax=== | ===Syntax=== | ||
<source lang="php"> | <source lang="php">isEnabled($component, $strict=false)</source> | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 17: | Line 17: | ||
!Description | !Description | ||
|- | |- | ||
| $ | | $component | ||
| | | | ||
| $ | | $component The component name | ||
|- | |- | ||
| $strict | | $strict | ||
| Line 36: | Line 36: | ||
===Source Body=== | ===Source Body=== | ||
<source lang="php"> | <source lang="php"> | ||
function isEnabled( $component, $strict = false ) | |||
{ | { | ||
$result = & | global $mainframe; | ||
return ($result->enabled | | |||
$result = &JComponentHelper::getComponent( $component, $strict ); | |||
return ($result->enabled | $mainframe->isAdmin()); | |||
} | } | ||
</source> | </source> | ||
Revision as of 22:09, 22 March 2010
Description
Checks if the component is enabled
Template:Description:JComponentHelper/isEnabled
Syntax
isEnabled($component, $strict=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| $component | $component The component name | |
| $strict | false | $string If set and a component does not exist, false will be returned |
Returns
boolean
Defined in
libraries/joomla/application/component/helper.php
Importing
jimport( 'joomla.application.component.helper' );
Source Body
function isEnabled( $component, $strict = false )
{
global $mainframe;
$result = &JComponentHelper::getComponent( $component, $strict );
return ($result->enabled | $mainframe->isAdmin());
}
[Edit See Also] Template:SeeAlso:JComponentHelper/isEnabled
Examples
<CodeExamplesForm />