| 5 install.php | hook_enable() |
| 6 install.php | hook_enable() |
| 7 system.api.php | hook_enable() |
| 8 system.api.php | hook_enable() |
Perform necessary actions after module is enabled.
The hook is called every time the module is enabled. It should be implemented in the module's .install file. The implementation can rely on the .module file being loaded.
See also
Related topics
11 functions implement hook_enable()
1 invocation of hook_enable()
File
- modules/
system/ system.api.php, line 3448 - Hooks provided by Drupal core and the System module.
Code
function hook_enable() {
mymodule_cache_rebuild();
}
Login or register to post comments
Comments
An example of using
An example of using hook_enable:
/*** Implement hook_enable()
*/
function yourmodulename_enable() {
drupal_set_message($message = t('The yourmodulename module was successfully enabled.'), $type = 'status');
}