0

I am trying to learn about creating modules by looking at the core code to see how the directory structure is formatted. I was looking at the Magento 1.9 sales module.

In the adminhtml.xml file, The mage_sales module has children which each have their own action. These actions contain 'adminhtml/sales_order' or 'sales_invoice' for example. How is this method accessed? I thought because it depends on Mage_Sales, this means in the Mage/Sales directory and then the action implies the directory of where that method that's being called. So i assumed it would be in Mage/Sales/Block/adminhtml/'and be here'.

I just want to understand where these actions are located and how they are being called as I can't find them and I would like to know how Magento structures their modules so I have some guidelines to follow by looking at their code.

0

Magento keeps all routes in the controllers folder under app/code/[codePool]/[Package]/[Module]/etc/ directory.

Below is a sample:

http://example.com/catalog/product/view/id/2

Base URL: http://example.com/

Module's front name: catalog

Controller class: product

Action name: view

Parameters and respective values: id/2

You can have multiple parameters in the same pattern.

Block folder is meant for serving functions which are called by phtml files using $this->functionName()

To deep dive into Magento's module structure, you can start from here.

Please let me know if you find any problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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