Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Magento 2

You're reading from   Mastering Magento 2 Maximize the power of Magento 2 to create productive online stores

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781785882364
Length 340 pages
Edition 2nd Edition
Languages
Tools
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Bret Williams Bret Williams
Author Profile Icon Bret Williams
Bret Williams
Jonathan Bownds Jonathan Bownds
Author Profile Icon Jonathan Bownds
Jonathan Bownds
Andre Gugliotti Andre Gugliotti
Author Profile Icon Andre Gugliotti
Andre Gugliotti
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Planning for Magento FREE CHAPTER 2. Installing Magento 2 3. Managing Products 4. Designs and Themes 5. Configuring to Sell 6. Managing Non-Product Content 7. Marketing Tools 8. Extending Magento 9. Optimizing Magento 10. Advanced Techniques 11. Pre-Launch Checklist Index

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:

Module architecture with nested directories

The following is a brief description of these directories and the programmatic roles of the files they contain:

  • Block/: This directory has PHP classes that contain logic to manage the view template. Blocks, therefore, are fundamentally related to display logic and are key to managing this logic.

  • Controller/: This directory contains controllers for the module. A controller is responsible for routing requests in Magento, and...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image