[Catalyst] $c->res->redirect and $c->detach

Matt S Trout dbix-class at trout.me.uk
Mon Sep 18 23:39:05 CEST 2006


John Napiorkowski wrote:
> Hi,
> 
> I have a controller with some chained actions.  One of
> the actions (not an endpoint) will redirect given a
> certain value for the arguments.  However I find that
> this doesn't stop the chain from completing.  I still
> get a line about the redirect in the log, but the
> endpoint in that chain still activates.
> 
> I find that this doesn't happen when I use $c->detach,
> although in this circumstance detach is not the best
> use for me.
> 
> Has anyone run into this before and found a way around
> it?

Calling $c->res->redirect never stops anything from completing, all it does is 
set the appropriate data on the response. $c->detach is the correct thing to 
do here.

Perhaps you need to rephrase your question in terms of why you feel detach 
isn't ideal and how that interacts with the way your architecture is put together?

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list