- Override a controller isn't a good idea: controllers are the most important part of code in a module and
override Magento Core Controller could create some problem in upgrading Magento.
- We should prefer add an observer that do some action on some events instead of override
Some time events doesn't suit our secrets desires so ...
**Es.**
Suppose we want to override the AccountController under **Mage/Customer/controllers/AccountController.php**
**Our Module:**
- NameSpace Name: Trollycoke
- Module Name: Customer
We create a directory structure like this:
app/code/local/Trollycoke/Customer/controllers/AccountController.php
app/code/local/Trollycoke/Customer/etc/config.xml
app/etc/modules/Trollycoke_Customer.xml
Our AccountController.php **must** include Magento Default one and extend it so ...
For the config.xml I found two ways to do that:
1. One with **route** tag directive --> **this way is good**
2. One with **rewrite** tag directive --> **this way create problems**
**1.** **
In config.xml in frontend node:
**2.** **
In config.xml in global node:
Nessun commento:
Posta un commento