Yes it works but in the same way it did before I tried to pass
variables or flash messages. It’s still a plain vanilla redirect. I’m
back to where I started is what I should have said.
Just to follow-up Walter, I got the flash “success” message to appear
on the form page (just as the flash “error” message does). I still
haven’t been able to pass the name variable to a separate (redirect)
page as I was originally trying to do but c’est la vie. I’ll deal with
that some other time.
This should just work if you change the $self link to a link to
success in the manage_result call. $link = '/folder/mar/success/' . $mar->id; and use $link in place of $self where you have it currently.
The session flash will be set by manage_result to the value of
$message, The next request for that session (inside of success) will
pick that up and display it as long as you have a line of code to
echo $_flash in your views/success.php page.
Walter
On Mar 27, 2011, at 11:29 AM, Todd wrote:
Just to follow-up Walter, I got the flash “success” message to
appear on the form page (just as the flash “error” message does). I
still haven’t been able to pass the name variable to a separate
(redirect) page as I was originally trying to do but c’est la vie.
I’ll deal with that some other time.
This should just work if you change the $self link to a link to
success in the manage_result call. $link = '/folder/mar/success/' . $mar->id; and use $link in place of $self where you have it
currently.
Curious. I’m not sure why but the “success” case goes missing.
Meaning, instead of a redirect the session flash loads in the same
(form) page.
Try losing the leading slash in the link. so it’s mar/success …
Walter
On Mar 27, 2011, at 1:03 PM, Todd wrote:
This should just work if you change the $self link to a link to
success in the manage_result call. $link = '/folder/mar/ success/' . $mar->id; and use $link in place of $self where you
have it currently.
Curious. I’m not sure why but the “success” case goes missing.
Meaning, instead of a redirect the session flash loads in the same
(form) page.
It could only do that if there are errors in the model after you
save it. manage_result has a very simple path:
Are there errors in the model after Save?
Yes → Show the form page again, with the errors in the local
flash.
No → Redirect to the success url with the message in the
session flash.
I know, it’s odd, there aren’t a lot of places for manage_result to go
off the tracks. There are no errors. The “success” flash loads in the
same page and the email gets sent and the data is passed to the db. It
must be something very obvious I’m overlooking.