Introduction to Magento

4,179 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,179
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
183
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Introduction to Magento

  1. 1. MagentoMagento hands on: building a module
  2. 2. Introduction● Magento framework ○ php/mysql ○ based on zend ○ MVC ○ OO ○ Addons● Magento architecture ○ http server (nginx) + CGI (php-fpm) / Apache ○ Mysql (percona or maria)● Magento optimizations ○ full page cache (memcached) ○ block cache (memcached) ○ APC
  3. 3. Magento internals● XML configuration files ○ for layout ○ for modules configurations● Controllers are always the entry point● Views are called blocks and are organized by the layout (xml file)
  4. 4. Magento skins● Organized in packages > themes● in each package or theme: layout, phtml files and translate files● Fallback mecanism to the base magento layouts and templates
  5. 5. A magento module● module declaration app/etc/modules/mymodule. xml● module files app/code/local/mycompany/mymodule/● module file architecture block, etc (configuration), controllers, model, sql● layout updates app/design/frontend/mypackage/mytheme● Object name is VERY important● NEVER change magento core files● Look at magento core files and extend them
  6. 6. etc folder● Often source of mistakes● config.xml ○ Declare all your resources (blocks, models, controllers, installation, version number, layout update files...)● system.xml ○ admin side configuration (menu, system/configuration...)● adminhtml.xml ○ ACL rights
  7. 7. Blocks● Block are loaded through the layout or controller● Block can and should be cached (be careful with the cachekey)● Block should only take care of the display
  8. 8. Controllers● Master of the application, redirects, organizes● one controller can include many actions● admin side controllers should be put inside a adminhtml folder
  9. 9. Models● All data access should be done there● Business logic
  10. 10. Models specificities● Event observers● Crons
  11. 11. Databases changes on install● Only triggered on version changes (check core_resource and config.xml)● Can add anything in the database (attributes, new tables, new users...)
  12. 12. Packaging your module● Use magento packaging tool● Think in advance (company, module name...)● Push to magentoconnect (easy if free, little more work if not)
  13. 13. Conclusion / links● POWERFUL :)● Useful links ○ http://alanstorm.com/ ○ http://inchoo.net/ ○ http://www.aschroder.com/ ○ http://www.blog.magepsycho.com/

×