[Catalyst] default template

John Napiorkowski jjn1056 at yahoo.com
Fri Dec 29 21:15:15 GMT 2006


--- Octavian Rasnita <orasnita at gmail.com> wrote:

> 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
> 

Yes, if you are missing an 'end' action in the current
controller it will walk up the tree until it get's to
the Root controller.  Whether you use Local or Path
for your login/out action shouldn't matter.  If the
final end action isn't being activated check to make
sure your Root controller has:

__PACKAGE__->config->{namespace} = '';

At the top and that none of your other controllers has
that.

--john


> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
>
http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Catalyst mailing list