简体   繁体   English

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

[英]How to give forgot password link from home page in Magento?

I have created a new template phtml file 2columns-right-home.phtml for home page of my Magento site. 我已经为我的Magento网站的主页创建了一个新的模板phtml文件2columns-right-home.phtml。 I want to give login form here. 我想在这里提供登录表格。 Also the links like 'create new account', 'Forgot Password', etc. How to give the links? 还有“创建新帐户”,“忘记密码”等链接。如何提供链接?

I tried the following: 我尝试了以下方法:

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

But the page is not directing to the link. 但该页面并未指向该链接。

Use the getUrl function to get the link to the forgotpassword action for the account controller of the customer module (whose frontName happens to also be customer , read more ). 使用getUrl函数获取customer模块的account控制器的forgotpassword操作的链接(其frontName恰好也是customer阅读更多 )。 As so: 如此:

<a href="<?php echo Mage::getUrl('customer/account/forgotpassword') ?>">Forgot password?</a>

More info on getUrl 有关getUrl更多信息

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

看着

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

Link For Forgot Password : 忘记密码链接:

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

Link for Account Create : 帐户创建链接:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM