- Magento 2 Developer's Guide
- Branko Ajzele
- 298字
- 2021-07-30 09:53:21
The module filesystem structure
Magento identifies itself as a highly modular platform. What this means is that there is literally a directory location where modules are placed. Let's take a peak at the individual module structure now. The following structure belongs to one of the simpler core Magento modules—the Contact
module that can be found in vendor/magento/module-contact
:
Block
composer.json
Controller
etc
acl.xml
adminhtml
system.xml
config.xml
email_templates.xml
frontend
di.xml
page_types.xml
routes.xml
module.xml
Helper
i18n
LICENSE_AFL.txt
LICENSE.txt
Model
README.md
registration.php
Test
Unit
Block
Controller
Helper
Model
view
adminhtml
frontend
layout
contact_index_index.xml
default.xml
templates
form.phtml
Even though the preceding structure is for one of the simpler modules, you can see that it is still quite extensive.
The Block
directory is where the view-related block PHP classes are located.
The Controller
directory is where the controller-related PHP classes are stored. This is the code that responds to the storefront POST
and GET HTTP
actions.
The etc
directory is where the module configuration files are present. Here, we can see files such as module.xml
, di.xml
, acl.xml
, system.xml
, config.xml
, email_templates.xml
, page_types.xml
, routes.xml
, and so on. The module.xml
file is an actual module declaration file. We will look into the contents of some of these files in the later chapters.
The Helper
directory is where various helper classes are located. These classes are usually used to abstract various store configuration values into the getter methods.
The i18n
directory is where the module translation package CSV files are stored.
The Module
directory is where the entities, resource entities, collections, and various other business classes can be found.
The Test
directory stores the module unit tests.
The view
directory contains all the module administrator and storefront template files (.phtml
and .html
) and static files (.js
and .css
).
Finally, the registration.php
is a module registration file.
- Getting Started with React
- C程序設計簡明教程(第二版)
- Java程序設計實戰教程
- Go語言高效編程:原理、可觀測性與優化
- 深入實踐Spring Boot
- 精通軟件性能測試與LoadRunner實戰(第2版)
- Windows Presentation Foundation Development Cookbook
- 軟件架構:Python語言實現
- JavaScript入門經典
- Learning FuelPHP for Effective PHP Development
- Selenium Testing Tools Cookbook(Second Edition)
- Scala Reactive Programming
- C#開發案例精粹
- C++反匯編與逆向分析技術揭秘(第2版)
- 微信小程序開發實戰:設計·運營·變現(圖解案例版)