Why do I get this error?
Fatal Error
Error: Call to a member function find() on a non-object
File: /home/mycake/public_html/app/Controller/TasksController.php
Line: 7
I think it has something to do with using CAKE 2.0 but I think the code in my controller might be CAKE 1.3? And I have done a bit of research but I don't know how to change the code to be in CAKE 2.0. Can anyone help?
This is the TasksController.php page
<?php
class TasksController extends AppController {
public $name = 'tasks';
public function index() {
//THIS IS THE LINE 7
$tasks = $this->Task->find('all');
$this->set('tasks', $tasks);
}
}
If you need any more info please ask because I'm not sure how else to make it more relevant to get an answer :)