我試圖找出ACL,所以我想通過本教程的書(1.3蛋糕的工作,由方式)。CakePHP的 - 包括ACL組件提供了致命的錯誤:的ConnectionManager了getDataSource :: - 不存在的數據源
我創建數據庫表(阿羅斯ACOS,aros_acos)。然而,當我嘗試在我的AppController中包含Acl組件時,當我嘗試訪問任何頁面時,出現致命錯誤:
致命錯誤(256):ConnectionManager :: getDataSource - 不存在的數據源[ CORE /蛋糕/庫/模型/ connection_manager.php,線102]
在我的AppController:
public $components = array('Auth','Session','RequestHandler','Acl');
從陣列使一切重新工作的組件刪除的ACL。當我在AppController中註釋掉一些代碼
的錯誤消失。這裏是代碼 - 註釋的行是罪魁禍首。 AppModel :: slugList()是一個自定義函數,它只是基於一個slu does查找查詢。它工作正常,至少直到Acl被包括在內。
if ($this->modelClass != 'Country'){
$this->loadModel('Country');
}
if ($this->modelClass != 'Category'){
$this->loadModel('Category');
}
$this->Session->write('Country',1);
$this->Session->write('City',1);
$_countryId = $this->Session->read('Country');
//$_countries = $this->Country->slugList();
$_cityId = $this->Session->read('City');
//$_cities = $this->Country->City->slugList();
編輯 - 也,三次通知顯示:
Notice (8): Trying to get property of non-object [CORE/cake/libs/model/datasources/dbo_source.php, line 813]
Notice (8): Trying to get property of non-object [CORE/cake/libs/model/datasources/dbo_source.php, line 838]
Notice (8): Trying to get property of non-object [CORE/cake/libs/model/datasources/dbo_source.php, line 841]