2012-10-03 23 views
4

我已经为我的magento网站的主页创建了一个新的模板phtml文件2columns-right-home.phtml。我想在这里提供登录表单。此外,像'创建新帐户','忘记密码'等链接。如何给链接?我尝试了以下内容:如何给从主页忘记密码链接 - magento

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

但是页面没有指向链接。任何帮助PLZ ..

回答

8

使用getUrl函数来获取链接forgotpassword行动为account控制器customer模块(其frontName恰好也是customerread more)。像这样:

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

More info on getUrl

+0

噢,非常感谢你..它的工作...... :) – Nina

-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> 
+0

对于这种特殊情况'getUrl'确实是最佳实践,让Magento为您做好工作!例如,如果Magento决定改变URL的工作方式?不太可能,但至少可以避免使用核心功能看不见的后果。 –

+0

是的。我接受.. 感谢您的信息。 –

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

看看

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