For explaining the module we will take a contact module as example
Module Name : contact
Module Fields : name, address1, address2, phone, joineddate
Module contains following
1) A module directory with module name.
Ex. create a directory with name 'contact' under modules diretory
2) A table in database with module's name. It is optional.
3) A config.php file inside the module directory. This file contains following variables.
a) $fields
Ex.
$fields=array();
$fields['name']=array
(
'type'=>'string',
'size'=>100,
'override'=>false
);
$fields['address1']=array
(
'type'=>'string',
'size'=>255,
'override'=>false
);
$fields['address2']=array
(
'type'=>'string',
'size'=>255,
'override'=>false
);
$fields['phone']=array
(
'type'=>'string',
'size'=>50,
'override'=>false
);
$fields['joineddate']=array
(
'type'=>'date',
'size'=>14,
'override'=>false
);
b) $table
Ex. $table='contact';
c) $actions
Ex. $actions=array
(
"create"=>array(),
"edit"=>array(),
"update"=>array(),
"insert"=>array(),
"delete"=>array(),
"list"=>array(),
"preview"=>array(),
"myaction"=>array(),
"myactiontwo"=>array()
);
d) $list_has_header
It allows to display the table coloumn in the listview
Ex. $list_has_header=true