CakePHP delete() function is not working
- by Logic Artist
Hello,
Im just cracking open cakePHP (v1.3.2). I set it up on my local wamp server, seems to work fine except the delete() function doesn't work. I'm following their blog tutorial exactly, its as simple as it can be so I don't understand why its not working.
Heres the function in my PostsController class:
function delete($id = NULL) {
$this->Post->delete($id);
$this->Session->setFlash('The post with id: '.$id.' has been deleted.');
$this->redirect(array('action'=>'index'));
}
The "Delete" link's url looks like
http://localhost/posts/delete/id:1 (where the id number matches the particular post, obviously). It redirects and sets the flash message, however there is no number where $id should be in the message, and the post isn't deleted. It seems the proper id is passed through the url, but I don't think it is getting into the function.
I dont get it. Any ideas???