Common Module Functions

Modules BuildX


register_activation_hook

/** * Register module activation hook * @param string $module module system name * @param mixed $function function for the hook * @return mixed */ register_activation_hook($module, $function)

register_deactivation_hook

/** * Register module deactivation hook * @param string $module module system name * @param mixed $function function for the hook * @return mixed */ register_deactivation_hook($module, $function)

register_uninstall_hook

/** * Register module uninstall hook * @param string $module module system name * @param mixed $function function for the hook * @return mixed */ register_uninstall_hook($module, $function)

register_cron_task

/** * Register module cron task, the cron task is executed after the core cron tasks are finished * @param mixed $function function/class parameter for the hook * @return null */ register_cron_task($function)

register_payment_gateway

 /** * Inject custom payment gateway into the payment gateways array * @param string $idpayment gateway id, should equal like the libraries/classname e.q. gateways/New_gateway * @param string $module module name to load the gateway if not already loaded */ register_payment_gateway($id, $module) 

register_language_files

/** * Register module language files to support custom_lang.php file * @param string $module module system name * @param array $languages array of language file names without the _lang.php * @return null */ register_language_files($module, $languages)

module_dir_url

/** * Module URL * e.q. https://crm-installation.com/module_name/ * @param string $module module system name * @param string $segment additional string to append to the URL * @return string */ module_dir_url($module, $segment = '')

module_dir_path

 /** * Module directory absolute path * @param string $module module system name * @param string $concat append additional string to the path * @return string */ module_dir_path($module, $concat = '')

module_libs_path

/** * Module libraries path * e.q. modules/module_name/libraries * @param string $module module name * @param string $concat append additional string to the path * @return string */ module_libs_path($module, $concat = '')

Did you find this article useful?

  • Introduction to Perfex CRM modules

    Modules BuildX The modules documentation is valid starting from version 2.3.2 Perfex CRM&...
  • Module Basics

     Modules BuildX The modules documentation is valid starting from version 2.3.2 Perfe...
  • Module File Headers

     Modules BuildX Each module in Perfex CRM consist of init file which contains the general...
  • Create Menu Items

    Modules BuildX If you are creating your custom modules, probably you will want to create menu ...
  • Module Security

     Modules BuildX So, you created your module and works fine, but is it secure? You must en...