2012-11-07 40 views

回答

1

我猜問題是,LangHelper覆蓋父__construct方法,防止蛋糕從正確設置助手。將LangHelper的__construct()更改爲以下內容:

public function __construct(View $View, $settings = array()) { 
    parent::__construct($View, $settings); 
    $this->mapper = $this->parseLangHeaders(); 
    $this->langCode = $this->findLangCode(); 
    $this->countryCode = $this->findCountryCode(); 
} 
+0

非常感謝Ben,現在沒事了) – Kamduras

0

你激活的AppControllerFormHelper

App::uses('FormHelper', 'View/Helper'); // Don't forget this one in Cake 2.x 

class AppController extends Controller 
{ 
    public 
    $helpers = array('Form'); 
}