views:

16

answers:

1

Hi,

I have a question regarding Magento's local directory.

I am trying to override a core controller - Mage/Contacts/controllers/IndexController.php.

So I copied IndexController.php to /app/local/Mage/Contacts/controllers/

but Magento is still using core file. I can confirm it because I see 404 page when I rename Mage/Contacts/controllers/IndexController.php to IndexController.php_.

Please advise me.

Thanks!

+3  A: 

Copying a controller into the app/code/local path doesn't work unfortunately due to Magento's autoload architecture. It does work with Blocks, Models and other objects, but not controllers.

There is a detailed walkthrough of how to override a controller on the wiki. And a blog post by @prattski

Try following those, then come back with any specific questions.

HTH, JD

Jonathan Day
It works!! Thanks!
Moon

related questions