[Catalyst-dev] RFC: DWIM redirects
Jonathan Rockway
jon at jrock.us
Tue Jan 9 16:36:47 GMT 2007
John Napiorkowski wrote:
> I have to agree, I know myself this caused a lot of
> trouble and confusion. I thinks this confusion
> happens because a lot of the time
> $c->request->redirect sort of does what you want,
> particularly if you are using any of the suggested
> default end actions, since those automatically do the
> right thing with redirect statuses. It's only when
> you 'go off the reservation' and start creating stuff
> that doesn't use the renderview action class or need
> to perform redirects that are not the very last
> statement in an action that cause you a lot of
> trouble.
I disagree. Instead of writing:
$c->response->redirect($c->uri_for('/path/to/something'));
$c->detach();
I want to write:
$c->redirect('/path/to/something');
Clear. Concise. DWIM.
--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
More information about the Catalyst-dev
mailing list