我为我的Magento网站的主页创建了一个新的模板phtml文件2columns-right-home.phtml。我想在这里提供登录表格。还有"创建新帐户","忘记密码"等链接。如何提供链接?
我尝试了以下方法:
<a href="<?php echo $this->getForgotPasswordUrl() ?>">Forgot password?</a>
但页面不会定向到链接。
使用 getUrl
函数获取指向 customer
模块的account
控制器的forgotpassword
操作的链接(其frontName
恰好也是customer
,阅读更多)。如下:
<a href="<?php echo Mage::getUrl('customer/account/forgotpassword') ?>">Forgot password?</a>
有关getUrl
的更多信息
Mage::helper('customer')->getForgotPasswordUrl()
看
var_dump(get_class_methods(get_class(Mage::helper('customer'))))
忘记密码的链接:
<a href="<?php echo Mage::getBaseUrl(); ?>customer/account/forgotpassword">Forget Password ?</a>
帐户创建链接:
<a href="<?php echo Mage::getBaseUrl(); ?>customer/account/create">Create Account</a>