[Catalyst] Dynamic Argument count
Tomas Doran
bobtfish at bobtfish.net
Tue Jan 12 00:01:56 GMT 2010
On 11 Jan 2010, at 23:00, Christoph Friedrich wrote:
> following given:
>
> URL: http://localhost:3000/guild/myrealm/myguild
> => Controller: guild
> => Action: list_guilds (chained, CaptureArgs(2))
>
> URL: http://localhost:3000/guild/myrealm/myguild/ajax
> => Controller: guild
> => Action: list_guilds (chained, CaptureArgs(3))
^^ Erm, this doesn't make much sense - you're not showing what things
are chained to, which makes a big difference..
> My problem is following: I want to add the parameter "ajax" (for
> example) directly to the url and not as a query parameter. Is there
> a possible way or do I have to add this parameter to the query?
sub base : Chained('/') PathPart('/guild') CaptureArgs(2) {}
sub list_guilds : Chained('base') PathPart('') Args(0) {}
sub list_guilds_ajax : Chained('base') PathPart('ajax') Args(0) {}
Is that what you want?
Cheers
t0m
More information about the Catalyst
mailing list