[Catalyst] "internal" redirect?
Bill Moseley
moseley at hank.org
Sat Nov 12 22:41:00 CET 2005
On Sat, Nov 12, 2005 at 09:05:38PM +0100, Marcus Ramberg wrote:
>
> Hey. Check out Catalyst::Plugin::SubRequest
That's what I ended up using. I'm wondering why that's not more of a
core feature -- an "internal redirect" that is. Especially if using
$c->uri_for(). If I use uri_for in a "list" action and forward there
from an "update" action, then links built with uri_for are wrong.
I realize another option is an http redirect, but this is what I'm
using in some cases now:
sub internal_redirect {
my ( $c, $action, @args ) = @_;
$action = join '/', $c->action->namespace, $action
unless $action =~ m!^/!;
$c->res->output( $c->subreq( $action, @args ) );
return;
}
--
Bill Moseley
moseley at hank.org
More information about the Catalyst
mailing list