2011-04-19 114 views
1

當我嘗試下訂單時,同時選擇送貨方式錯誤是越來越說致命錯誤:調用一個成員函數的setTitle()非對象

Fatal error: Call to a member function setTitle() on a non-object in /home/exclus31/public_html/../../../app/code/core/Mage/Customer/Block/Form/Login.php on line 40 

但有沒有問題下訂單並獲得特定訂單的確認信息。

任何人都知道爲什麼會顯示此錯誤併爲此提供解決方案?

+0

Magento的什麼版本? – 2011-04-19 07:32:45

+0

我有一種感覺,它與你使用../../../ – 2011-04-19 15:41:10

回答

4

我也有這個錯誤。這是因爲我在加載佈局之前在我的IndexAction()中調用了getLayout()。只需致電loadLayout()第一,像這樣:

public function IndexAction() { 
    $this->loadLayout(); // do this first 
    $this->getLayout()->getBlock('head')->setTitle($this->__('My Title')); // then this works 
    $this->renderLayout(); // render as usual 
} 

我希望這有助於

相關問題