Presentation is loading. Please wait.

Presentation is loading. Please wait.

Magento #1 - MVC - Template - WorkFlow

Similar presentations


Presentation on theme: "Magento #1 - MVC - Template - WorkFlow"— Presentation transcript:

1 Magento #1 - MVC - Template - WorkFlow
VIDA Magento #1 - MVC - Template - WorkFlow Demo repository:

2 MVC Mage_Model Mage_Model_Resource Mage_Controller_Front Mage_Events
Mage_Block Mage_Helper

3 Class naming conversion
Zend-style Format Mage_Catalog_Model <Namespace>_<Module-name>_Model_ Notes: Case sensitive Camelcase Likipe_Demo_Model_CustomerService Subfolder for each “dash”

4 Class naming conversion
Override class app/local/Mage/ app/core/Mage/

5 Controller Routing Front controller URL Rewrite HTACCESS
Verify routing Mage::app()->getFrontController()->getRequest()->getRouteName()

6 Model E.A.V (Entity–Attribute–Value) Use Resources Mage::getModel()
Mage::getSingleton() Resources DB layer to work with MySQL = table in MySQL

7 View Blocks Theme Block .phtml .css .js .xml

8 Block Template: “A Block is a box (or any other form) where your module is shown”

9 Block Develop: “A Block is a class that includes all functions which helps to display data in view”

10 Block - Types #1. “Built-in” #2: “Dynamic data” #3: “Static data”
Mage_Catalog_Block_Category_Navigation Mage_Catalog_Block_Product #1. “Built-in” Mage_Core_Block_Template XXX_YYY_Block_ZZZ #2: “Dynamic data” Mage_CMS_Block #3: “Static data”

11 .phtml .xml cms Block – How to call
echo $this->getLayout() ->createBlock('letter/subscribe') ->setTemplate('newsletter/subscribe.phtml') ->toHtml(); .phtml <block type="cms/block" name="cms_site_info“ before="-" as="my_site_info“ /> $this->getChildHtml(‘cms_site_info’) .xml {{block type="tag/popular" name="tags_popular" template="tag/popular_index.phtml" }} cms

12 Template - theme Theme Concept skin app css layout images template js
locale theme

13 Template - theme Layouts : XML files, define block structure(module layout) , in which you decide to put some box in some page as a module function. Templates : phtml files, in which you do the coding with xhtml and PHP. Locale: language translations in .csv file format. Skins : css, images, javascript, where u do the beautifications.

14 Theme fallback

15 Theme development

16 Theme development Init Empty folders XML local.xml PHTML *.phtml

17 Workflow – Theme development
Page page/1column.phtml page/2-column-left.phtml Header/Footer page/html/head.phtml page/html/header.phtml page/html/footer.phtml Content *.phtml

18 Workflow – Theme development
Use local.xml Remove/add blocks Change template file Copy xml files: Layout change (modify on many blocks) Copy phtml files Keep the PHP codes (correct data) HTML changes only Translate via /locale/sv_SE/translate.csv

19 Minimum template files
Workflow Requirement Minimum template files Layout via XML Fallback process


Download ppt "Magento #1 - MVC - Template - WorkFlow"

Similar presentations


Ads by Google