Cakephp错误:对非对象调用成员函数find()

Cakephp错误:对非对象调用成员函数find(),php,cakephp-1.3,Php,Cakephp 1.3,我的代码有问题。当我尝试调试我的web应用程序时,我收到以下错误消息…对非对象调用成员函数find()…这是我的代码 类TeamsController扩展了AppController{ var $name = 'Teams'; function index() { $this->set('teams', $this->team->find('all')); } function Welcome() { } var $name = 'Posts'; function

我的代码有问题。当我尝试调试我的web应用程序时,我收到以下错误消息…对非对象调用成员函数find()…这是我的代码

类TeamsController扩展了AppController{

var $name = 'Teams';

function index() {
$this->set('teams', $this->team->find('all'));

}

function Welcome() {

}
var $name = 'Posts';

function index() {
    $this->set('posts', $this->Post->find('all'));
}

function hello_world() {

}
}

我正在尝试显示MySQL数据库中的记录。话虽如此,我完成了本教程,并按照说明进行操作……但不知何故,我的代码存在bug。我的代码和我做的教程代码之间的唯一区别是变量名…和控制器名…还有我没有hello world函数。。。下面是我做的教程中的代码示例

类PostsController扩展了AppController{

var $name = 'Teams';

function index() {
$this->set('teams', $this->team->find('all'));

}

function Welcome() {

}
var $name = 'Posts';

function index() {
    $this->set('posts', $this->Post->find('all'));
}

function hello_world() {

}
}


话虽如此,我是否应该声明一个对象实例以使其工作?

这可能是一个区分大小写的问题:

function index() {
    $this->set('teams', $this->Team->find('all'));
}
如果没有,请确保您的控制器可以访问团队模型(例如,
$uses