In this post we will explain the process of creation of a module in Magento. In order to create a module named as helloworld under demo namespace in the Magento we need to do the following steps:
Step-1: Create a directory structure for the new module under “app/code/local/Demo/Helloworld”. Our directory structure should look as follows:
Directory Structure for Module
Step-2: Create a config file names as config.xml at app/code/local/Demo/Helloworld/etc. This file will have the code in the form
Code Template for Config File
so our config file will have the code
Config File Code for HelloWorld
Step-3: Create a file to activate a module at path “app/etc/modules/Demo_Helloworld.xml”. This file will have the code with the template as follows:
Code Template for Module Activation
so our file will have to code as
Code for Activation HelloWorld
Step-4: Verify that module has been successfully created and activated by clearing Magento cache. After clearing the cache go to Magento backend and then go to System->Configuration->Advanced. Expand “Disable Modules Output” and see Demo_Helloworld shows up.
Congratulation! we have successfully created the module in the Magento. In our next post we will discuss about Routes Creation and creating action controllers in Magento.
Latest posts by Rajat Jain (see all)