$this->flash(...) does not redirect
Hi everybody
I have baked CRUD for my Users controller, but it seems that the
generated code is buggy...?!
As to my understanding, $this->flash(...) should redirect to the page
specified in the supplied 2nd argument.
But whether my add nor my edit actions redirect - they just show a
blank page with the flash message, and that's it!
Here's the code for the edit action (I generated everything, nothing
edited):
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->flash(__('Invalid User', true), array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->User->save($this->data)) {
$this->flash(__('The User has been saved.', true), array('action'
=> 'index'));
} else {
}
}
if (empty($this->data)) {
$this->data = $this->User->read(null, $id);
}
}
I've played around a bit... at least $this->redirect works.
function asdf() {
$this->flash('blah', array('action' => 'index')); // Does not work
$this->redirect(array('action' => 'index')); // Does work
}
Anyone got an idea, what's wrong here? I'm using CakePHP 1.2.8.
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 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

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home