Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Magento PHP Developer????s Guide, 2nd Edition
  • Table Of Contents Toc
  • Feedback & Rating feedback
Magento PHP Developer????s Guide, 2nd Edition

Magento PHP Developer????s Guide, 2nd Edition

By : MacGregor
2 (4)
close
close
Magento PHP Developer????s Guide, 2nd Edition

Magento PHP Developer????s Guide, 2nd Edition

2 (4)
By: MacGregor

Overview of this book

This book is written for PHP developers who are familiar with frameworks such as Zend or CakePHP and want to start developing and working with Magento. No prior knowledge of Magento is required.
Table of Contents (11 chapters)
close
close
10
Index

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 subdivided into three important directories:
    • code: This contains all our application code divided into three code pools, namely core, community, and local
    • design: This contains all the templates and layouts for our application
    • locale: 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 Magento
  • media: This contains all the images and media files for our products and CMS pages, as well the product image cache
  • lib: 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 the Varien and Mage directories
  • skin: This contains all CSS, images and JavaScript used by the corresponding theme
  • var: 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 divided 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:

The Magento folder structure

Let's review each folder further:

  • Block: In Magento, blocks form an additional layer of logic between the controllers and views
  • controllers: These are formed by actions that process webserver requests
  • Controller: Classes in this folder can be abstract classes and they can be extended by the controller class under the controllers folder
  • etc: In this we can find the module-specific configuration in the form of XML files such as config.xml and system.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 well
  • Model: This contains models that support the controllers in the module to interact with data
  • sql: These contain the installation and upgrade files for each specific module
  • data: 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.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Magento PHP Developer????s Guide, 2nd Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon