[Catalyst] default template

Octavian Rasnita orasnita at gmail.com
Fri Dec 29 20:57:41 GMT 2006


From: "Eden Cardim" <edencardim at gmail.com>

> No, there isn't. Catalyst only emits the response after all the
> actions are dispatched. One way you can keep the end action from
> running is by not having one. In your case, set up a Controller
> without an end action just for authentication. In there, you can set
> up Path actions so you don't have to rewrite all the URLs you've
> already got in your code:

sub logout : Path('/user/logout'){
    my ($self, $c) = @_;
    $c->logout;
    $c->res->redirect($c->uri_for('/'));
}

I have something similar, a controller without an end subroutine, but the 
logout subroutine uses the : Local parameter instead of Path.

In that case, the last action is the end subroutine from the Root.pm 
controller.
If I will use Path instead of Local, the end subroutine from Root.pm won't 
be executed anymore?

I thought that if the controller doesn't have a certain Private action 
defined, the program executes that action from the parent controller, and if 
that controller doesn't have it, from the parent, and so on, until the root.

Octavian




More information about the Catalyst mailing list