CakePHP call to a member function on a non object .
Posted: Thu Aug 26, 2010 5:35 pm
Does anyone determine what's wrong with this code?
Call to a member function find() on a non-object in E:\xampp\htdocs\cake\app\controllers\posts_controller.php on line 7
Code: Select all
<?php
class PostsController extends AppController
{
var $name='Posts';
function index(){
$posts=$this->post->find('all',array('id','title','content','created','modified','published'), 'id DESC');
$this->set(compact('posts'));
}
}
?>