What is a Magento module?
A module is a logical group – that is, a directory containing blocks, controllers, helpers, models – that are related to a specific business feature. In keeping with Magento’s commitment to optimal modularity, a module encapsulates one feature and has minimal dependencies on other modules.
Modules and themes are the units of customization in Magento. Modules provide business features, with supporting logic, while themes strongly influence user experience and storefront appearance. Both components have a life cycle that allows them to be installed, deleted, and disabled. From the perspective of both merchants and extension developers, modules are the central unit of Magento organization.
The Magento Framework provides a set of core logic: PHP code, libraries, and the basic functions that are inherited by the modules and other components.
Purpose of a module
The purpose of a module is to provide specific product features by implementing new functionality or extending the functionality of other modules. Each module is designed to function independently, so the inclusion or exclusion of a particular module does not typically affect the functionality of other modules.
A module is a directory that contains the PHP and XML files (blocks, controllers, helpers, models) that are related to a specific business feature, such as Shipping. Specifically, a Magento module is composed of these software components: themes, libraries, and language packages.
Modules typically live in the
vendor directory of a Magento installation, in a directory with the following PSR-0 compliant format:
<type> can be one of the following values:
module- for modules (
theme- for frontend and admin themes (
language- for language packs (
For example, the Customer Import/Export module of Magento can be found at
If you are creating a new module for distribution, create the
app/code/<vendor>/<type>-<module-name> directory and the required directories within it.
Inside this folder, you will find all the code related to this module, including the
etc/module.xml file, which contains the name and version of the module, as well as any dependencies.
Module location conventions
The following table shows the recommended location within the Magento file system for specific components.
must include a
registration.php file in its root folder.)
We refer to a component’s root directory as the top-level directory in which you develop component code. Typically, this directory is located in one of the following directories relative to the Magento root directory:
|Code base of your custom module||
|Custom theme files (storefront)||
|Custom theme files (modules)||
|If you want to use a library||
Working with modules
Magento developers, administrators, and anyone building a Magento website will want to review all relevant topics surrounding their particular goals and use cases.
See PHP Developer Guide for specific instructions on extending modules.
See Frontend Developer Guide for information on implementing themes and other components.