Error: Call to a member function find() on a non-object
Error: Call to a member function find() on a non-object
File: C:\wamp\www\cake222\app\Controller\AddressesContro ller.php
Line: 6
I am on page 105 Chapter 4: List of All Addresses in the book and get the above error.
The AddressesController gets to the index function below and gets the error.
<?php
class AddressesController extends AppController {
var $name = 'addresses';
function index($id = null) {
$this->set('address_list', $this->Address->find('all'));
}
I cannot continue. What am I doing wrong?
I am using Cake 2.2.2 and PHP 5.3.8 and Apache 2.2.21 and MySQL 5.5.16.
I have the addresses table in the cake database with 1 record.
|