:::: MENU ::::

Magento Certification: Module initialization (I)

5.00 avg. rating (83% score) - 1 vote

This post continues the series for Magento Certification, this time we’ll cover the Study Guide section «Module Initialization» and how the installed Modules are loaded by Magento during the initialization.

Describe the steps needed to create and register a new module

A Magento minimal extension needs only two files:

First file must be located in the folder app/etc and its name should be like Namespace_Modulo.xml. The content of this file will tell Magento where to find the rest of the files of the extension. Something like this:

<?xml version="1.0" encoding="UTF-8"?>
<config>
   <modules>
      <NV_Newmodule>
         <active>true</active>
         <codePool>local</codePool>
      </NV_Newmodule>
   </modules>
</config>

This tells Magento that our new extension is located into the local codepool, and thus Magento will check the folder app/code/local/NV/Newmodule/etc to find a configuration file for the extension, called config.xml. Its contents shoul be like:

<?xml version="1.0"?>
<config>
<modules>
<NV_Newmodule>
<version>0.1.0</version>
</NV_Newmodule>
</modules>
</config>

Of course, this extension do nothing useful, but it is start, isn’t it? ;)




Hey! Qué opinas sobre el artículo?