我是cakephp的新手,並嘗試使用控制檯工具生成一些CRUD操作。除了一張桌子(最大)以外,它工作正常。錯誤:調用成員函數find()在cakephp控制器中的非對象
當嘗試添加了新的元素,它返回:
Error: Call to a member function find() on a non-object File: C:\wamp\www\cakephp\app\Controller\ChantiersController.php
Line: 50
這是該行50及以後:
$programs = $this->Chantier->Program->find('list');
$etats = $this->Chantier->Etat->find('list');
$types = $this->Chantier->Type->find('list');
$champsLibres = $this->Chantier->ChampsLibre->find('list');
$feuillesDeRoutes = $this->Chantier->FeuillesDeRoute->find('list');
$directionsPilotes = $this->Chantier->DirectionsPilote->find('list');
$this->set(compact('programs', 'etats', 'types', 'champsLibres',
'feuillesDeRoutes', 'directionsPilotes'));
請出示的var_dump'輸出( $ this-> Chantier-> Program);' – DaveRandom 2012-07-13 16:25:04
你能否包含第49行以防萬一? – Dave 2012-07-13 17:39:19