[Catalyst] redirect problem

Len Jaffe lenjaffe at jaffesystems.com
Mon Apr 17 16:35:27 CEST 2006



> fayland <fayland at gmail.com> wrote: 
> it complains like *|Can't call method "user_id" on
> an undefined value*, 
> I know I don't log in.
> *But* I expect that the "redirect" should be
> immediately occurred. it 
> shouldn't meet the $c->user->user_id
> Now it seems that the "redirect" runs after the
> whole subroutine. 

This is because redirect() is a method that
manipulates the response headers.  You have to
complete the request in order to get your headers and
content sent to the client.

Len.



More information about the Catalyst mailing list