1

My controller is not being read by Magento though and I can't find my error. I would like it to extend the admin sales order info controller and pass a variable to the renderLayout().

config.xml:

<config>
    <-- other -->
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <mymodule before="Mage_Adminhtml">MyApp_MyModule_Adminhtml</mymodule>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <!--other-->
</config>

MyApp\MyModule\controllers\IndexController.php:

class MyApp_MyModule_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action {
    public function indexAction()
    {
        $this->loadLayout();
        Mage::helper("adminhtml")->getUrl("myapp_mymodule/index/index");
        $this->renderLayout();
    }
}
3

You can either move you controller file location or update you config.xml

Method 1 : Move your controller file from

MyApp\MyModule\controllers\ButtonController.php

to

MyApp\MyModule\controllers\Adminhtml\ButtonController.php

Or Method 2 : change your config.xml and update your class definition

<mymodule before="Mage_Adminhtml">MyApp_MyModule_Adminhtml</mymodule>

to

 <mymodule before="Mage_Adminhtml">MyApp_MyModule</mymodule>
2

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.