[英]Cakephp, connect the database to the webpage
在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 home() {
$homepage = $this->paginate($this->Pages);
$this->set(compact('homepage'));
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.