Enabling & Disabling
The addon modules may include both enabling and disabling functions. These functions work when the status of an add-on is enabled or disabled in the administrator panel. The add-on can be used to execute any code required when enabling or disabling the module.
For example, can be used to special tables, create database entries or to return a message or error to a user to perform license checks. It can also be used if you want to show the process as it failed due to a problem, or inform the user about a missing field or license issue.
Sample Enabling Function
public function activate(){
/*
* Here, you can perform any intervention before the module is activate.
* If you return boolean (true), the module will be activate.
*/
return true;
}
Sample Disabling Function
public function deactivate(){
/*
* Here, you can perform any intervention before the module is deactivate.
* If you return boolean (true), the module will be deactivate.
*/
return true;
}