如何在Magento的主页上给忘记密码链接?

时间:2012-10-03 07:01:09

标签: php magento magento-1.6 magento-1.7

我为我的Magento网站的主页创建了一个新的模板phtml文件2columns-right-home.phtml。我想在这里提供登录表格。还有“创建新帐户”,“忘记密码”等链接。如何提供链接?

我尝试了以下内容:

<a href="<?php echo $this->getForgotPasswordUrl() ?>">Forgot password?</a>

但该页面并未指向该链接。

3 个答案:

答案 0 :(得分:8)

使用getUrl功能获取forgotpassword模块的account控制器customer操作的链接(frontName碰巧也是customer模块<a href="<?php echo Mage::getUrl('customer/account/forgotpassword') ?>">Forgot password?</a> read more)。如此:

{{1}}

More info on getUrl

答案 1 :(得分:2)

Mage::helper('customer')->getForgotPasswordUrl()

看看

var_dump(get_class_methods(get_class(Mage::helper('customer'))))

答案 2 :(得分:-3)

忘记密码链接:

<a href="<?php echo Mage::getBaseUrl(); ?>customer/account/forgotpassword">Forget Password ?</a>

帐户创建链接:

<a href="<?php echo Mage::getBaseUrl(); ?>customer/account/create">Create Account</a>