CakePHP call to member function on non-object
- by joec
I have the following Model and Controller files, and when i visit this url, http://....../pois/index i get this error:
Notice (8): Undefined property: PoisController::$Poi [APP/controllers/pois_controller.php, line 5]
Fatal error: Call to a member function find() on a non-object in /home/joecoyle/public_html/app/controllers/pois_controller.php on line 5
The Model is this, called poi.php:
<?php
class Poi extends AppModel {
}
?>
And the controller is this, named pois_controller.php
<?php
class PoisController extends AppController {
function index(){
$this->set('pois',$this->Poi->find('all'));
}
}
?>
As i am new to CakePHP i am not sure what is causing this error, as everything seems to be named, right, and i am following the tutorial on the CakePHP site...
Thanks