Jason Purdy wrote:
This is when CGI::Application::Dispatch helps out, tremendously. Once
you set it up, the action in your case translates to the runmode along
with optional parameters.
http://search.cpan.org/~markstos/CGI-Application-Dispatch-2.14/lib/CGI/Application/Dispatch.pm
Yes, sorry, should have said I'm using Dispatch, but it's not always
helpful, as I have some rules that mean /myapp/foo/do_stuff points to
the do_stuff() method in Foo.pm, but /myapp/admin/bar/do_stuff points to
do_stuff() in Admin::Bar.pm not Admin.pm. So setting debug => 1 in
Dispatch gives me "app = foo" in the 1st example - that's OK. But in the
second, "app = bar", whereas I want to capture 'admin'.
And runmode is not actually what I'm after, eg default(), do_stuff() are
all runmodes of Foo.pm, and it's 'foo' I'm after, as in
<http://localhost/myapp/foo>.
Have solved it (I think) in the template using c.query.path_info, as in:
[% FOREACH action_links # hash defined previously %]
<a href="[% c.query.url %]/[% link %]"
[% IF c.query.path_info.match('^/' _ link) %]id="selected"[% END %]>
[% label %]</a>
[% END %]
--
Richard Jones
##### CGI::Application community mailing list ################
## ##
## To unsubscribe, or change your message delivery options, ##
## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp ##
## ##
## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ##
## Wiki: http://cgiapp.erlbaum.net/ ##
## ##
################################################################