Getting the admin panel URLs in Magento
A page in Magento’s administration panel works similar to front-end pages, there is an admin controller for each of all pages in the admin panel. The controller resides in the controllers/Adminhtml/ directory in the module directory.
For example, the URL index.php/admin/customer/edit/id/7
, admin is referencing the module name, customer
in URL is referencing the controller class, edit
is referencing the edit action of the controller and id
is the parameter for the edit action.
1. The url for customer page in the admin panel: index.php/admin/customer/edit/id/7
echo Mage::helper('adminhtml')->getUrl('adminhtml/customer/edit/index/id',array('id'=>7));
2. The url for catalog product page in the admin panel: index.php/admin/catalog_product/edit/id/166
echo Mage::helper('adminhtml')->getUrl('adminhtml/catalog_product/edit/index/id',array('id'=>166));
3. The url for sales order in the admin panel: index.php/admin/sales_order/view/order_id/8
echo Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view/order_id/',array('order_id'=>8));
4. The url for sales report page in the admin panel: index.php/admin/report_sales/sales
echo Mage::helper('adminhtml')->getUrl('adminhtml/report_sales/sales/');
5: The url for sales report page with some dummpy parameters in the admin panel: index.php/admin/report_sales/sales/id/123/date/20140818
echo Mage::helper('adminhtml')->getUrl('adminhtml/report_sales/sales/id/date',array('id'=>123,'date'=>20140818));
Please login or create new account to add your comment.