2

I am new to magento,I have created a custom module for magento backend. I don't know how to get its url, I have tried some help from online, nothing happens, please tell what should I pass into getUrl function.How should I use $url = Mage::helper("adminhtml")->getUrl('/your_module/index'); my file

confic.xml

<modules>
    <Petra_DailyOrders>
        <version>1.0.0</version>
    </Petra_DailyOrders>
</modules>

<global>
    <helpers>
        <petra_dailyorders>
            <!-- Helper definition needed by Magento -->
            <class>Mage_Core_Helper</class>
        </petra_dailyorders>
    </helpers>
</global>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <petra_dailyorders before="Mage_Adminhtml">Petra_DailyOrders_Adminhtml</petra_dailyorders>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

<adminhtml>
    <layout>
        <updates>
            <petra>
                <file>dailyorders.xml</file>
            </petra>
        </updates>   
    </layout>
</adminhtml>

1
  • I tried answer given on this and other forums, I am unable to solve it, so now I came here for help. Nov 13, 2015 at 7:58

1 Answer 1

3

generate it like this:

$url = Mage::helper("adminhtml")->getUrl('admintml/your_module/index');

So you should place your controller in

Petra/DailyOrders/controllers/Adminhtml/ControllerName.php and call it like this

$url = Mage::helper("adminhtml")->getUrl('admintml/controllername/index');
4

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.