Database Cakephp,将数据库连接到网页
在cakephp中连接数据库时,我收到以下通知和警告:Database Cakephp,将数据库连接到网页,database,cakephp,Database,Cakephp,在cakephp中连接数据库时,我收到以下通知和警告: Notice (8): Undefined variable: homepage [APP/Template\Pages\home.ctp, line 180] Warning (2): Invalid argument supplied for foreach() [APP/Template\Pages\home.ctp, line 180] 我在显示数据库中的数据时遇到了这个问题 编辑这是我的控制器 public function
Notice (8): Undefined variable: homepage [APP/Template\Pages\home.ctp, line 180]
Warning (2): Invalid argument supplied for foreach() [APP/Template\Pages\home.ctp, line 180]
我在显示数据库中的数据时遇到了这个问题
编辑这是我的控制器
public function home() {
$homepage = $this->paginate($this->Pages);
$this->set(compact('homepage'));
}
公共函数home(){$homepage=$this->paginate($this->Pages);$this->set(compact('homepage');}这是我的控制器检查您的路由。
/pages/home
是否实际由home
功能处理?