[Catalyst] Detach won't detach?

koniczynek koniczynek at uaznia.net
Mon Jan 26 19:34:13 GMT 2009


On Mon, 26 Jan 2009 20:05:50 +0100, Lars Balker Rasmussen <lars at balker.dk>
wrote:
> auto relies on a return value to tell the dispatcher whether to continue
> or not.
> Doing the normal action is the default, detaching to it is redundant,
> hence:
> 
> sub auto :Private {
>   my ( $self, $c ) = @_;
> 
>   if ( ! user_logged_in) {
>     $c->redirect( $c->req->base );
>     return 0;
>   }
> 
>   return 1;
> }
This works like a charm. Thank you.

> This example is pretty much exactly the same as in the main Catalyst pod.
I looked there and found nothing. Bad searcher I am.

-- 
k




More information about the Catalyst mailing list