[Catalyst] Transferring control via root/auto

Tomas Doran bobtfish at bobtfish.net
Fri Dec 10 15:55:56 GMT 2010

On 9 Dec 2010, at 14:41, Thompson wrote:

> How would you use a chained dispatch to solve a problem like this?   
> Something that needs to be checked before allowing anything else  
> (besides logging in) to happen and if so force them to a specific  
> page?  A simple example would help.

The simplest example I can think of - CatalystX::SimpleLogin provides / 
login/required and /login/not_required as chain bases.

Anything chained from /login/required requires login :)

Obviously, displaying the login page is _not_ chained from /login/ 
required (as otherwise you have the same issue as here)

> I'm still have it in my head that this logic should be done in the  
> root controller since it would supersede any action in my other  
> controllers.

There is nothing special about the root controller that implies this.

It's just generally people put the start of their chains in the Root  

As demonstrated by the above example (with the chain starts in the  
Login controller), this isn't mandatory.

Does this help clarify?


More information about the Catalyst mailing list