The new Magento module architecture

Much like Magento 1.0, Magento 2 is divided into modules. These modules are meant to encapsulate functionality related to a certain business feature. The framework provides organization for these modules, which can be found in the app/code directory with the following convention: app/code/(vendor)/(modulename).

Under the (modulename) directory, there are a series of nested directories that contain the blocks, helpers, controllers, and models that make up a module. The hierarchy looks like this:

The new Magento module architecture

Module architecture with nested directories

The following is a brief description of these directories and the programmatic ...

Get Mastering Magento 2 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.