你好我加入了CakePHP的一個動態的子菜單,出現此錯誤:CakePHP的控制器
Notice (8): Undefined property: PagesController::$GamesRewiewTypes
我已經創建控制器進行調用rewiew_types_controller.php
,它不工作嗎?
App_Controller.php:
$rewiewTypes = $this->GamesRewiewTypes->find('all', array('conditions' => array('GamesRewiewTypes.menu_show' => 1), 'order' => 'GamesRewiewTypes.title ASC'));
$rewiewTypes = Set::combine($rewiewTypes, '{n}.GamesRewiewTypes.title', array('/reviews/{0}', '{n}.GamesRewiewTypes.id'));
$mainMenu = array(
'3dreviews' => $rewiewTypes,
);
Rewiews_Type_Controller.php:
class RewiewTypesController extends AppController {
var $name = 'rewiewTypes';
var $uses = array('GamesRewiewTypes');
Pages_Controller.php:
class PagesController extends AppController {
var $uses = array('Banner');
public function index() {
$banners = $this->Banner->find('all', array('order' => 'position ASC'));
$this->set('banners', $banners);
/*
pr ($banners);
exit;
*/
}
您沒有正確輸入函數中加載模型'Rewiew'當你想鍵入'Review'? – DaveRandom
這是以前的編碼器和整個結構錯誤inc inc數據庫.... – user974435
heya隊友,你可以發佈一些更多的代碼?你不能通過創建文件來使用控制器。你需要添加它...和rewiew_types_controller錯過遊戲的某處無論如何:D –