Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento View/Block pattern
 
seldon
Sr. Member
 
Total Posts:  92
Joined:  2007-11-08
 

Having seen a number of View implementations in differnent frameworks, the View implementation in Magento seems new to me. Is it an implementation of a particular software pattern ? As far as i understand it, you have a layout (defined in the main.xml) which specifies a main layout and the particular ‘blocks’ of html that are contained in this layout, depending on the page that is being served. What was the reason for choosing an xml layout config instead of implementing a more php oriented layout definition?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

There are many incentives to use a markup language for any data that is intended to be modified, extended and customized. Some of them:

* GUI customization interface (as a tree, wysiwyg drag’n’drop, etc)
* Ability to apply downloaded customizations with minimum or none of developer intervention
* Simplified way of bringing customization for specific elements (categories, products, cms pages) directly from admin, instead of editing code.

There are much more advantages to this approach, you can fill in the blanks smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top