脚本宝典收集整理的这篇文章主要介绍了php – 覆盖Magento Contacts Controller,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
<?PHP require_once 'Mage/Contacts/controllers/IndexController.PHP'; class Mynamespace_CustomContacts_IndexController extends Mage_Contacts_IndexController { PRotected function indexAction () { die; } }
我还将此代码放在Mynamespace / CustomContacts / etc / config.XMl中
<config> <frontend> <routers> <contacts> <args> <modules> <Mynamespace_CustomContacts before="Mage_Contacts">Mynamespace_CustomContacts</Mynamespace_CustomContacts> </modules> </args> </contacts> </routers> </frontend> </config>
我清理了缓存,但我死了;不起作用,
谢谢你的帮助
<?xml version="1.0"?> <config> <modules> <Mynamespace_CustomContacts> <version>0.1.0</version> </Mynamespace_CustomContacts> </modules> <frontend> <routers> <contacts> <args> <modules> <Mynamespace_CustomContacts before="Mage_Contacts">Mynamespace_CustomContacts</Mynamespace_CustomContacts> </modules> </args> </contacts> </routers> </frontend> </config>
2.糟糕的做法
您可以在app / local / Mage / Contacts / controllers / IndexController.PHP中移动控制器以进行硬覆盖.
并且不要忘记在app / etc / modules目录中的xml文件中启用您的模块
以上是脚本宝典为你收集整理的php – 覆盖Magento Contacts Controller全部内容,希望文章能够帮你解决php – 覆盖Magento Contacts Controller所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。