Hi everybody
I'm learning CakePHP and I'm reading through the Blog tutorial. So far
everything works well, except the delete action. When clicking on
Delete, I get the following errors:
Warning (2): Missing argument 1 for PostsController::delete() [APP
\controllers\posts_controller.php, line 24]
Code
}
function delete($id) {
PostsController::delete() - APP\controllers\posts_controller.php, line
24
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83
Notice (8): Undefined variable: id [APP\controllers
\posts_controller.php, line 25]
Code
function delete($id) {
$this->Post->delete($id);
PostsController::delete() - APP\controllers\posts_controller.php, line
25
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83
Notice (8): Undefined variable: id [APP\controllers
\posts_controller.php, line 26]
Code
function delete($id) {
$this->Post->delete($id);
$this->Session->setFlash('The post with id: '.$id.' has been
deleted.');
PostsController::delete() - APP\controllers\posts_controller.php, line
26
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83
Warning (2): Cannot modify header information - headers already sent
by (output started at C:\xampp\htdocs\josh\blog\cake\libs\debugger.php:
673) [CORE\cake\libs\controller\controller.php, line 746]
Code | Context
$status = "Location: http://localhost/josh/blog/posts"
header - [internal], line ??
Controller::header() - CORE\cake\libs\controller\controller.php, line
746
Controller::redirect() - CORE\cake\libs\controller\controller.php,
line 725
PostsController::delete() - APP\controllers\posts_controller.php, line
27
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83
Any idea what's the problem? Something with the routing, maybe?
Thanks
Josh
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en