Extensions are package into mvc structure (i.e Model, View, Controllers) along with the sql, cron and importer file.
The structure of the package are shown below:
The database configuration are to be placed in the sql folder of the package with “file.sql” file extension.
If the package includes cron file, then it should be placed in the “cron” folder.
The importer file should have certain methods to be followed:
copy_dir
sql
mkdir
cron_file
copy_dir is use to copy the entier directory from the package to the modules folder WManager
syntax: (copy_dir, dummy/, application/modules/dummy)
First parameter “copy_dir” is the function name
Second parameter is the source folder from the extension package
Third parameter is destination folder where the file has to copy
sql is use to run the database queries
syntax: (sql, file.sql, sql/)
First parameter “sql” is the function name
Second parameter is file name from the extension folder
Third parameter is extension folder database folder path from which file has to process
mkdir is use to create the directory in the specified location
syntax: (mkdir, cm, assets/uploads/)
First parameter “mkdir” is the function name
Second parameter is the folder name which has to create
Third parameter is the path from wmanager where folder should get create
cron_file is use to create the directory in the specified location
syntax: (cron_file, test.php, cron/)
First parameter “cron_file” is the function name
Second parameter is the file name of the cron file
Third parameter is the folder from which the cron file should copy
Extension dummy folder should contain the following:
assets : should include all the css and js files
config : should include “routes.php” file which will contain all the routes for the particular extension
controllers : should include all the controllers files for the particular extension
helpers : should include any helper function for the extension if it nessasary
libraries : should include any lirabry for the extension if it nessasary
models : should include all the model files for the particular extension
views : should include all the templates files for the particular extension