I was working with PHP Core and custom MVCs by 1 and half years until when moved to magento desk.

I find it very difficult first, but later got grip in Theme integration and maintenance of previously done modules. Now I got in to Module creation and really confused with the architecture.

In frank, Everytime when I write a new code, It works well, but later edited out wasting so much time of seniors since It does not met completely with Magento's coding style.

For an example, when I need to check something and update a database, I writes,

$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = "SELECT ststus FROM table WHERE Id='".$id."'";
$select_query = $readConnection->fetchOne($query);
$update_value= $select_query[0];
$writeConnection = $resource->getConnection('core_write');
$query = "UPDATE table SET field_name='C' WHERE Id='".$id."'";

This is later changed to simply this,

foreach ($dealroomIds as $dealroomId) {
                $manufacturers = Mage::getSingleton('module/module')
                    ->setStatus($this->getRequest()->getParam('status')); //getting status 
                    $manufacturers->setRunningStatus('C'); // setting new status
                Mage::getSingleton('dealroom/deals')->UpdateDealProducts($dealroomId); // Update

The above given is just an example and nothing more than that.

To know more about the coding style and standard, I think is neccessory to know more about

  • Block
  • controllers
  • Model
  • Helper
  • Data

I searched but whatever I read and understand is just far away from the basic. If anyone point out the connections and functions of these, it will be helpful to me.

3 Answers 3


Best practice? http://www.alanstorm.com, great blog that explains all the basics. I learned Magento this way :). Take a look at the creation of backend and frontend extensions!

  • 1
    btw if you have senior Magento devs, asking them for good tutorials or example extensions made by them would also help you alot ;) Feb 12, 2013 at 9:02
  • Hehe you should thank Alan :D I'm just the messenger ^^ Feb 15, 2013 at 12:13

A good start would be Magento Developer Knowledge base articles Then as mentioned, read Alan Storm's articles and watch Fundamentals of Magento Development Video Course by Magento (Ben Marks)

After that, I think, you should have a look at official Extension's Developer Guide by Magento - 80 pages on how-to create a custom extension (News) from scratch


There are tons of useful and well written guide to create and understand module architecute.

Just to name a few :



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.