- Magento PHP Developer's Guide(Second Edition)
- Allan MacGregor
- 422字
- 2021-07-16 13:16:02
The Magento folder structure
The Magento folder structure is slightly different from other MVC applications. Let's take a look at the directory tree, and each directory and its functions:
app
: This folder is the core of Magento and is subpided into three important directories:code
: This contains all our application code pided into three code pools, namely core, community, and localdesign
: This contains all the templates and layouts for our applicationlocale
: This contains all the translation and e-mail template files used for the store
js
: This contains all the JavaScript libraries that are used in Magentomedia
: This contains all the images and media files for our products and CMS pages, as well the product image cachelib
: This contains all the third-party libraries used in Magento (such as Zend and PEAR) as well as the custom libraries developed by Magento, which reside under theVarien
andMage
directoriesskin
: This contains all CSS, images and JavaScript used by the corresponding themevar
: This contains our temporary data, such as the cache file, index lock files, sessions, import/export files, and in the case of the Enterprise edition, the full page cache folders
Magento is a modular system. This means the application, including the core, is pided into smaller modules. For this reason, the folder structure plays a key role in the organization of each module. A typical Magento module folder structure would look something like this:

Let's review each folder further:
Block
: In Magento, blocks form an additional layer of logic between the controllers and viewscontrollers
: These are formed by actions that process webserver requestsController
: Classes in this folder can be abstract classes and they can be extended by thecontroller
class under thecontrollers
folderetc
: In this we can find the module-specific configuration in the form of XML files such asconfig.xml
andsystem.xml
Helper
: This contains auxiliary classes that encapsulate a common module functionality and make them available to a class of the same module and to other modules classes as wellModel
: This contains models that support the controllers in the module to interact with datasql
: These contain the installation and upgrade files for each specific moduledata
: This folder was introduced in Magento 1.6 CE and it is used in a manner similar to SQL scripts, but data scripts are only concerned about inserting data
As we will see later in this chapter, Magento makes heavy use of factory names and factory methods. This is why the folder structure is so important.
推薦閱讀
- Designing Machine Learning Systems with Python
- 程序員面試白皮書(shū)
- Clojure for Domain:specific Languages
- Python數(shù)據(jù)結(jié)構(gòu)與算法(視頻教學(xué)版)
- 快速入門(mén)與進(jìn)階:Creo 4·0全實(shí)例精講
- 寫(xiě)給程序員的Python教程
- Unity Character Animation with Mecanim
- C編程技巧:117個(gè)問(wèn)題解決方案示例
- Learning Grunt
- JavaScript悟道
- 循序漸進(jìn)Vue.js 3前端開(kāi)發(fā)實(shí)戰(zhàn)
- 算法學(xué)習(xí)與應(yīng)用從入門(mén)到精通
- Learning Spark SQL
- C#從入門(mén)到精通(第5版)
- 響應(yīng)式編程實(shí)戰(zhàn):構(gòu)建彈性、可伸縮、事件驅(qū)動(dòng)的分布式系統(tǒng)