Hye, you can help me to cater this problem.
I have this problem. I'm using version 2.0.4 (the latest version).
I'm trying to solve this problem, but it didn't works.
Fatal error: Call to a member function _findPost() on a non-object in
C:\xampp\htdocs\cakecms\Controller\PostsController.php on line 35
public function admin_view($id = null) {
$this->Post->id = $id;
if (!$this->Post->exists()) {
throw new NotFoundException(__('Invalid post'));
}
$post = $this->Controller->Post->_findPost($id); //this is line
35.
$this->set(compact('post'));
}
# Protected
function _findPost($id = null)
{
$post = $this->Post->find('first', array('conditions' =>
array('Post.id = ' => $id)));
if (empty($post))
{
$this->Session->setFlash(__('Post not found', true));
$this->redirect(array('action'=>'index'), null, true);
}
return $post;
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php