[Catalyst] Chained actions with can't terminate with :PathPart('') ?

Alexander Hartmaier alexander.hartmaier at t-systems.at
Sat May 8 07:14:12 GMT 2010


Trevors example might overwhelm you a bit if you're not already that
familiar with chained.

The thing to understand is, every endpoint needs to end with an action
that uses Args, every part in the chain CaptureArgs, both might be (0).

So in your example you need a middle chain part for lot with two
endpoints, one with Args(0) to match just /lot and another one with
Args(1) that captures the lot id and matches /lot/5.

HTH

--
Best regards, Alex


Am Freitag, den 07.05.2010, 19:12 +0200 schrieb Evan Carroll:
> I have two destinations in my Catalyst app
>
> /auth/company/5/lot
> /auth/company/5/lot/5
>
> This works and is often seen in Catalyst apps to achive this effect.
> sub lot :Chained('/auth/company') :CaptureArgs(1) {
> sub view_lot :Chained('/auth/company') :PathPart('') :Args(1) {
>
> However, I would also expect the below to work; but, it seems it doesn't. I
> can only formulate the effect I want the above way. This is
> unfortunate because if all chained descendants of `lot` utilize a
> check provided here in the chain, then shouldn't `view_lot` also get
> to utilize that code? It would certainly be nice to eliminate
> redundant code here.
> sub lot :Chained('/auth/company') :CaptureArgs(1) {
> sub view_lot :Chained('/auth/company/lot') :PathPart('') :Args(0) {
>
> I think it is also confusing to those that first encounter it.
>
> I always know that I could just call it /view, and be done with it, but still.
> /auth/company/5/lot/5/view rather than, /auth/company/5/lot/5
>
> But, I just wanted to know what others thought of this.
>


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*



More information about the Catalyst mailing list