我尝试覆盖控制器中的功能/app/code/core/Mage/Customer/controllers/AccountController.php
。
我创建模块文件夹:
/app/code/local/Mandarin/SkipLogoutSuccess/etc/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Mandarin_SkipLogoutSuccess>
<version>0.1.0</version>
</Mandarin_SkipLogoutSuccess>
</modules>
<frontend>
<routers>
<checkout>
<args>
<modules>
<mandarin_skiplogoutsuccess before="Mage_Customer">Mandarin_SkipLogoutSuccess</mandarin_skiplogoutsuccess>
</modules>
</args>
</checkout>
</routers>
</frontend>
</config>
/app/code/local/Mandarin/SkipLogoutSuccess/controllers/AccountController.php
require_once 'Mage/Customer/controllers/AccountController.php';
class Mandarin_SkipLogoutSuccess_AccountController extends Mage_Customer_AccountController
{
public function logoutAction()
{
$this->_getSession()->logout()->setBeforeAuthUrl(Mage::getUrl());
Mage::log("its Allive!", null, 'mygento.log');
$this->_redirectUrl(Mage::getUrl());
}
}
/app/etc/modules/Mandarin_SkipLogoutSuccess.xml
<?xml version="1.0"?>
<config>
<modules>
<Mandarin_SkipLogoutSuccess>
<active>true</active>
<codePool>local</codePool>
</Mandarin_SkipLogoutSuccess>
</modules>
</config>
当我从核心运行 logoutAction 控制器时。在我的日志文件中,我没有收到消息。错误可能在哪里?