[Catalyst] $c->forward and don't come back?

Rusty Conover rconover at infogears.com
Thu Jun 9 20:29:31 CEST 2005


Christopher Heschong wrote:

>I keep find myself often wanting to do the following:
>
>sub foo : Local
>{
>   my ($self, $c, $id) = @_;
>
>   MyApp::M::CDBI::Table->retrieve($id)
>      or $c->forward('error');
>
>   $c->stash->{template} = 'foo.tmpl';
>
>}
>
>
>sub error : Local
>{
>   my ($self, $c) = @_;
>   $c->stash->{template} = 'error.tmpl';
>}
>
>
>The problem is, when I forward over to error, it does its work and then
>comes back and finishes processing foo, setting the template to
>'foo.xhtml'.  Is there something like forward that doesn't come back?  I
>know there is $c->redirect but if I'm not mistaken that sends an HTTP
>redirect, which isn't exactly what I was hoping for.
>
>  
>

I've wondered the same thing, but short of a eval {} & die() I'm not 
sure how you could do it.

Rusty

-- 
Rusty Conover
InfoGears Inc.
http://www.infogears.com
406-587-5432





More information about the Catalyst mailing list