0
我有這樣的錯誤:CakePHP的2.X:如何將數據傳遞到的意見
Notice (8): Undefined variable: informations [APP/View/Information/index.ctp, line 2]
我有這個功能在我的控制器
public function index($slug){
$this->layout = 'sbhealth';
$this->loadModel('Menu');
$informations = $this->Menu->findBySlug($slug);
if($informations){
$this->set('index', $informations);
}else{
return $informations = "not find";
}
}
我需要DATAS傳遞給我的看法「 index.ctp「index.ctp然後會在我的數組中找到ID以將它傳遞給Element。但視圖不承認「$信息」
感謝戴夫的幫助,我的壞,我第一個是我在Codeigniter的想法:! –
thks!我必須等待幾分鐘! –