190 likes | 336 Views
VIDA. Magento #1 - MVC - Template - WorkFlow. MVC. Mage_Model Mage_Model_Resource. Mage_Controller_Front Mage_Events. Mage_Block Mage_Helper. Class naming conversion. Zend -style Format Mage_Catalog_Model <Namespace>_<Module-name>_Model_ Notes: Case sensitive Camelcase
E N D
VIDA Magento #1- MVC- Template- WorkFlow
MVC • Mage_Model • Mage_Model_Resource • Mage_Controller_Front • Mage_Events • Mage_Block • Mage_Helper
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”
Class naming conversion • Naming conversion
Controller • Routing • Front controller • URL Rewrite • HTACCESS • Verify routingMage::app()->getFrontController()->getRequest()->getRouteName()
Model • E.A.V (Entity–Attribute–Value) • Use • Mage::getModel() • Mage::getSingleton() • Resources • DB layer to work with MySQL • = table in MySQL
View • Blocks • Theme
Block • Template: “A Block is a box (or any other form) where your module is shown”
Block • Develop: “A Block is a class that includes all functions which helps to display data in view”
Template - theme skin app css layout Theme Concept images template js locale theme
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.
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