我已经创建了一个新模块来替换客户/帐户菜单,并且有一个链接www.mysite.com/account
我现在想要更改登录,注册和其他页面以显示为www.mysite.com/account/login等
而不是恢复到客户/帐户/登录等
最好的办法是什么?
这是我到目前为止所做的config.xml代码....
<?xml version="1.0"?>
<config>
<modules>
<SquareNetMedia_MyAccount>
<version>0.1.0</version>
</SquareNetMedia_MyAccount>
</modules>
<frontend>
<routers>
<myaccount>
<use>standard</use>
<args>
<module>SquareNetMedia_MyAccount</module>
<frontName>account</frontName>
</args>
</myaccount>
</routers>
<layout>
<updates>
<myaccount>
<file>myaccount.xml</file>
</myaccount>
</updates>
</layout>
</frontend>
<global>
<helpers>
<myaccount>
<class>SquareNetMedia_MyAccount_Helper</class>
</myaccount>
</helpers>
<blocks>
<myaccount>
<class>SquareNetMedia_MyAccount_Block</class>
</myaccount>
</blocks>
</global>
</config>
答案 0 :(得分:0)
将文件更改为:
<frontend>
<routers>
<myaccount>
<use>standard</use>
<args>
<module>SquareNetMedia_MyAccount</module>
<frontName>account</frontName>
</args>
</myaccount>
<customer>
<args>
<modules>
<SquareNetMedia_MyAccount before="Mage_Customer_AccountController">SquareNetMedia_MyAccountr</SquareNetMedia_MyAccount>
</modules>
</args>
</customer>
然后在模块的控制器文件夹
中创建一个名为AccountController.php的新控制器文件<?php
require_once Mage::getModuleDir('controllers','Mage_Customer').DS.'AccountController.php';
class SquareNetMedia_MyAccount_AccountController extends Mage_Customer_AccountController{
}
现在您可以覆盖功能
public function loginAction(){
#Here you can do what you need I think
}
我希望这是对的,如果不清楚,请告诉我。和平。