Magento: get url for adminhtml

If you need to get correct url in Magento admin you can use this code:

<?php
    $url = Mage::helper("adminhtml")->getUrl("package_module/controller/action");
?>

On frontend you can use this code

<?php
    $url = Mage::getUrl('package_module/controller/action/', ['param_1' => $value]);
?>

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.