Actions

JModuleHelper/isEnabled

From Joomla! Documentation

Returns true if there is at least one module of the given name/type available; returns false otherwise. To return true there must be at least one module that satisfies the following criteria:

  • it is enabled;
  • it is assigned to the current menu item or is assigned to all menu items;
  • the user meets the access level requirements.

Syntax

boolean isEnabled( $module )

where:

Argument Data type Description Default
$name string The name/type of the module. For example, 'login' for the login form module. Will also return true if the module is not found and the 'mod_' prefix has been used.

Example

Determine if the login form module is available.

jimport( 'joomla.application.module.helper' );
$login = JModuleHelper::isEnabled( 'login' );
echo ($login) ? 'Login module is available' : 'Login module is not available';

See also