【发布时间】:2015-11-19 07:33:00
【问题描述】:
我正在尝试在表名联系人中显示我的所有数据,但它给了我一个错误 Call to a member function find() on null。我不明白这是什么意思。请帮忙!
<?php
class ContactsController extends AppController {
var $name = "Contacts";
public function index() {
$this->set('contacts', $this->Contacts->find('all'));
}
}
?>
【问题讨论】:
-
改写这个。 $this->联系方式->find('all')
-
我猜你使用的是 cakephp 2 所以我添加了适当的标签
标签: cakephp cakephp-2.0