following code as part of an edit function (which I believe is the
"Cake" way:
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Product', true));
$this->redirect(array('controller' => 'products',
'action'=>'index'));
}
I thought the result of this would be if a user trys to access /edit/
foo (foo does not exist) then they would be redirect and shown an
error message.
What actually happens, is that the form appears with no data in it and
the form actions to "/edit".
I have checked a few other cake apps and it appears to be the case
with them as well.
It is a minor point, but I'm just wondering if I have to add something
else, I'm guessing it is because /edit/$id serves as a catch all, and
technically an ID is set...
Any ideas?
Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
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:
Post a Comment