Hi,

I'm giving my first shot at using this chained action thing and I'm not sure if 
I have this right.

If I have a catalyst controller like so:

package myapp::templates

[...]

sub pages :Path Args(0)
{
    [...]
}

sub page :Chained('/') PathPart('templates') CaptureArgs(1)
{
    [...]
}

sub view :Chained('page') PathPart('view') Args(0)
{
    [...]
}

sub edit :Chained('page') PathPart('edit') Args(0)
{
    [...]
}

For the pages action it matches "/templates/pages" and for the two chained 
actions it matches "/templates/*/view" and "/templates/*/edit".  I'm confused 
about having to specify PathPart('templates') in the page action.  If I leave 
this empty (PathPart()) It matches "/page/*/(view|edit)" which is different 
what I might think is would do based on my understanding of the Path attribute, 
which matches to the action based on the controller namespace if you leave it 
blank, as I did in the pages action.

So, am I doing this right?  To be honest my intution suggestions that Path and 
PathPart are very similar and should have similar defaults and the fact that 
that don't seem to tells me I am not understanding the best way to use this 
feature.

 Please let me know what you all think!

--john



_______________________________________________
List: Catalyst@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/

Reply via email to