tags:

views:

76

answers:

2

I appreciate the ability to be able to do: http://server/controller/runmode or even http://server/controller/runmode/id. But if I have a lot of optional parameters I'd like to be able to do the regular: http://server/controller/runmode?foo=bar&baz=frew, especially since I have a lot of JS that will do the latter for me. Does anyone know of a way to allow for this functionality?

Thanks!

Edit: Ok, I figured it out with help from mpeters. To get params generated by CAD you obviously just do $self->param('foo'), but if you want regular params you do $self->query()->param('bar')

+3  A: 

You don't have to do anything magical for that to work, it'll work by itself. You just retrieve them differently. If it's coming from the CGI query string then you get it by

$self->query('param_name')

If it's coming from the PATH_INFO (the part that CGI::Application::Dispatch handles) then you get it by

$self->param('param_name')

mpeters
If you fix this I'll mark it as The Answer
Frew
A: 

Edit: Ok, I figured it out with help from mpeters. To get params generated by CAD you obviously just do $self->param('foo'), but if you want regular params you do $self->query()->param('bar')

Frew