Generate Magento Admin URL with Parameters and Key

To generate Magento Admin URL with Parameters and Key, use below given codes:

Mage::helper("adminhtml")->getUrl("module_name/controller_name/action_name/",array("param1"=>1,"param2"=>2));

To generate a link for the design Configuration, here is an example:

Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit", array('section'=>'web'));

The adminhtml helper will automatically create url with keys attached to the URL.

If you want to generate keys used in the URL, use below given codes:

Mage::getSingleton('adminhtml/url')->getSecretKey("adminhtml_customcontroller","customaction");

Leave a Reply

Your email address will not be published.