ModuleΒΆ

Class Vtiger_Module provides an API to work with vtiger CRM modules.

include_once('vtlib/Vtiger/Module.php');
$moduleInstance = new Vtiger_Module();
$moduleInstance->name = 'Payslip';
$moduleInstance->save();
$moduleInstance->initTables();
$menuInstance = Vtiger_Menu::getInstance('Tools');
$menuInstance->addModule($moduleInstance);

Vtiger_Module->initTables() API will initialize (create) the 3 necessary tables a module should have as explained below:

Table

Naming convention

Description

BaseTable

vtiger_<MODULENAME>

Contains the default fields for the new module

Customtable

vtiger_<MODULENAME>cf

Contains custom fields of the module

Vtiger_Menu->addModule(<ModuleInstance>) API will create menu item which serves as UI entry point for the module.