I have Mage 1.9 with my custom module installed. I have checked that the function


return wrong url with admin path. We also use a custom path for the admin area. This is my config.xml

                            <Mymodule_Mymodule before="Mage_Adminhtml">Mymodule_Mymodule_Adminhtml</Mymodule_Mymodule>


Now, calling Mage::getUrl('mymodule/api/users/1') from admin area return this url:


Can anyone help?


I am not sure to understand what you are trying to achieve but you should look at the getUrl method definition : app/code/core/Mage/Core/Block/Abstract.php:1001.

The first param of this method should be the 'route' : i.e ỳour_router_name/your_controller_name/your_action_name. And if you want to pass param, it should be as an array in the second param of the getUrl method.

Something like : Mage::getUrl('mymodule/api/your_action_name', array('users'=>1)).

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.