Community Documentation

v3 Knowledgebase

Create your own module

You create a new module when you want to add a feature to your site, for example if you want to have a block displaying the latest or top rated musicians you would do this with a block and this block needs to belong to a module, since you made that block why not use your own module?

When creating a module you need a folder in the /module/ folder, lets suppose the new module is named: newModule. The structure would look like this:
(1) /module/
(2) /module/newModule/
(3) /module/newModule/include/
(4) /module/newModule/include/component/
(5) /module/newModule/include/component/ajax/
(6) /module/newModule/include/component/block/
(7) /module/newModule/include/component/controller/
(8) /module/newModule/include/service/
(9) /module/newModule/static/
(10) /module/newModule/static/css/
(11) /module/newModule/static/jscript/
(12) /module/newModule/template/

I will quickly mention the purpose of a few folders now:
(1) All the modules are stored here
(3) The logic in your module lies here
(7) The controllers are the orchestra directors, they call the services when they're needed and assign values to the template files
(8) The services provide the pure logic as in fetching from the database, storing in database, in general manipulation of the phpfox libraries.
(12) Your looks are stored here and they depend on the theme