I am having a bear of a time saving the simplest record from a model called ItemView:
if($this->save($this->data)) {
echo \'worked\';
} else {
echo
What is the name of controller you are using?
Mismatching the name of controller and model also cause some errors. If you are using Posts controller then the Post
model should be used. If you are using Post
model inside other controller; say BlogsController
then the Post
model should be loaded like following:
loadModel("Post");
//Here I'm loading other model inside blogs controller
if($this->request->is('post'))
{
$this->Post->save($this->request->data);
}
}
}
?>