我已经为我的magento网站的主页创建了一个新的模板phtml文件2columns-right-home.phtml。我想在这里提供登录表单。此外,像'创建新帐户','忘记密码'等链接。如何给链接?我尝试了以下内容:如何给从主页忘记密码链接 - magento
<a href="<?php echo $this->getForgotPasswordUrl() ?>">Forgot password?</a>
但是页面没有指向链接。任何帮助PLZ ..
我已经为我的magento网站的主页创建了一个新的模板phtml文件2columns-right-home.phtml。我想在这里提供登录表单。此外,像'创建新帐户','忘记密码'等链接。如何给链接?我尝试了以下内容:如何给从主页忘记密码链接 - magento
<a href="<?php echo $this->getForgotPasswordUrl() ?>">Forgot password?</a>
但是页面没有指向链接。任何帮助PLZ ..
使用getUrl
函数来获取链接forgotpassword
行动为account
控制器customer
模块(其frontName
恰好也是customer
,read more)。像这样:
<a href="<?php echo Mage::getUrl('customer/account/forgotpassword') ?>">Forgot password?</a>
链接忘记密码:
<a href="<?php echo Mage::getBaseUrl(); ?>customer/account/forgotpassword">Forget Password ?</a>
链接帐号创建:
<a href="<?php echo Mage::getBaseUrl(); ?>customer/account/create">Create Account</a>
对于这种特殊情况'getUrl'确实是最佳实践,让Magento为您做好工作!例如,如果Magento决定改变URL的工作方式?不太可能,但至少可以避免使用核心功能看不见的后果。 –
是的。我接受.. 感谢您的信息。 –
Mage::helper('customer')->getForgotPasswordUrl()
看看
var_dump(get_class_methods(get_class(Mage::helper('customer'))))
噢,非常感谢你..它的工作...... :) – Nina