To install the Module Creator, you can use the Magento Connect Manager with the extension key, or install it manually as follows. Note that if you install via the Connect Manager the path it uses is /moduleCreator.

Copy the index.php file and the Blank folder to your webserver. You may want to put it in it’s own folder so that the index file does not conflict with other index files. Example: mysite.com/module_creator/

Go to the module creator index page in your web browser, and fill in the desired module information. If you enter your Magento directory, the module creator will attempt to install the module directly into Magento, though file permissions must be set correctly for this to happen. If your file permissions are incorrect, or you do not want the module installed right away, you can leave the Magento Directory blank, and the module creator will create the module in a folder called [i]new[/i], and place it in the module creator’s folder.

Please note that if you enter in your magento directory to install to you must have the correct path. Let’s say that you have Magento installed here:

http://www.my_site.com/magento/

And you have the Module Creator installed here:

http://www.my_site.com/moduleCreator/

This means that the path that you would need to enter in the Module Creator is this:

Magento Modules follow a common naming scheme, Namespace_Module. This is very important to remember as you need to be careful about how you name your classes. Every custom module will be created in the directory:

/app/code/local

The first step in creating your custom module is determining the namespace and module name. The namespace is simply an extra division that you can create you module in. This means that you can have two modules named the same thing if they are in two different namespaces. One way to use namespaces is to use your company name or initials for all of your modules. If my company name is Acme and I am creating a module called News the full module name would be Acme_News. Magento uses the namespace Mage. There is nothing stopping you from using that namespace under local, i.e. you could create Mage_News and that would work just fine.

Note : You can not use underscore within your module name

Note2: It seems that currently, if you use upper case characters in module names (expecting to show word starts since neither - nor _ is allowed)... the install will fail or rather the module will not work. Suggestion: use a single upper case character, at the beginning of the name.

Magento requires there to be an XML file that tells Magento to look for and use your custom module.

/app/etc/modules/<Namespace>_<Module>.xml

<?xmlversion="1.0"?>

<config>

<modules>

<[Namespace]_[Module]>

<active>true</active>

<codePool>local</codePool>

</[Namespace]_[Module]>

</modules>

</config>

Also you can disable your module in the Configuration menu on the backend via the Advanced tab.

NOTE: Due to a bug in Magento, whitespace is not treated correctly. This means that if you leave space in the values between node names (anything in angled brackets <> is a node), Magento will break.

As an explanation of the above code you will see that all you are changing is the [Namespace]_[Module] text and leaving everything else the same. Please note the capital P in codePool. If this is lowercase this module will not be active.

NOTE: You may notice that there is no closing, ?>, PHP tag in the code. This is a common coding style that Magento core classes use. Magento Coding Standard is similar (with some exceptions) to Zend Framework PHP Coding Standard and you can find the detailed explanations of this rule in Zend Framework Documentation

If you are quite new to Magento you should pay attention to one of its specifics! The Constructors below are not the usual PHP-Constructors!! Keeping that in mind can save hours of frustrating crashes ;)

These control the setup and appearance of your grids and the options that they display.

NOTE: Please note the fact that Block comes before Adminhtml in the class declaration. In any of the Magento modules in Adminhtml it is the opposite. For your module to work it has to be Block_Adminhtml otherwise you will get a ‘Cannot redeclare module...’ error.