JComponentHelper/isEnabled: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 45: | Line 45: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=isEnabled | category=isEnabled | ||
category=JComponentHelper | category=JComponentHelper | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 01:24, 25 March 2017
Description
Checks if the component is enabled
<! removed transcluded page call, red link never existed >
Syntax
static isEnabled($option, $strict=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| $option | $option The component option. | |
| $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
public static function isEnabled($option, $strict = false)
{
$result = &self::getComponent($option, $strict);
return ($result->enabled | JFactory::getApplication()->isAdmin());
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples