Override Magento Core Abstract Controller

controllersoverrides

I want to override Mage_Adminhtml_Controller_Action in my module Mycompany_Mymodule.

I've searched the net,but I couldn't find anyway to do this. Is it like the controllers, or it has a different way?

I appreciate any help.

Best Answer

You cannot override that controller.
Well...actually you can but it will have no effect.
The Mage_Adminhtml_Controller_Action class is never instantiated. It is there as a common parent class for the rest of the admin controllers.
even if you find a way to rewrite it all the other admin controllers will extend the original class so your modification will be useless.

If you want to change something in it you have to copy it to app/code/local/Mage/Adminhtml/Controller/Action.php and make your modifications there.

Here are more details about why you cannot rewrite some classes in Magento

Related Topic