Monday, November 30, 2009

managing the "missing argument" errors

hello.

is there any clever (simple?) way to manage the "missing argument"
error?

for example:

if i call directly from the browser's address bar an url like this

"http://localhost/cake/myapp/myctrl/edit/" (please note the missing
id)

PHP will prompt me an error like this

Warning (2): Missing argument 1 for MyController::edit(), called in
[...]\cake\libs\object.php on line 116 and defined [app
\My_Controller.php, line 40]

right now i'm using a lot of

if (!isset($param)) $this->redirect("gg no re", "/". strtolower($this-
>name)));

but that's unconfortable...

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: