On May 15, 4:40 pm, Carl Vondrick <[EMAIL PROTECTED]>
wrote:
> On Thu, May 15, 2008 at 04:33:51PM +0200, Gunnar Lium wrote:
> > When executing this code, the redirect works fine, but both action_ok and
> > action_error are set. This means that after redirecting, the code in the
> > catch-block is executed. Is this the expected behavior? It seems a bit odd
> > to
> > me...
>
> ->redirect() and ->forward() both throw an sfStopException no matter
> what. You must catch those and throw them again.
>
> Carl
Ok. It was pretty easy to circumvent:
}catch (Exception $e) {
$errors = true;
$this->setFlash('action_error', 'Error message');
}
$this->redirectUnless($errors, '@other_action');
I guess there's a good explanation for why forward/redirect throws an
exception. Care to provide a two-sentence briefing?
-gunnar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---