2012-10-03 24 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'))))