1

I have checked Overriding community adminhtml controllers but all are not working. Related questions: override community controller in local codepool. Rewrite controller magento

I have to rewrite the adminhtml controllers in the Path:

community/Magestore/Slider/controllers/Adminhtml/SliderController.php

to My Local path:

local/Mymodule/Slider/controllers/Adminhtml/SliderController.php

My Config.xml:

<admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Mymodule_Slider before="Magestore_Slider_Adminhtml">Mymodule_Slider</Mymodule_Slider>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

SliderController.php

require('Magestore/Slider/controllers/Adminhtml/SliderController.php');

class Mymodule_Slider_Adminhtml_SliderController extends Magestore_Slider_Adminhtml_SliderController
{
    public function indexAction()
    {
        echo '1';die();
    }
}

it is not coming into the Slider controller overridden in the local. What was wrong with my code ? Thanks

1 Answer 1

2

I think your config your be the following:

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Mymodule_Slider before="Magestore_Slider_Adminhtml">Mymodule_Slider_Adminhtml</Mymodule_Slider>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Since your controller is called Mymodule_Slider_Adminhtml_SliderController then I think the section of your config.xml should match and be Mymodule_Slider_Adminhtml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.