Reputation: 9544
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')
Upvotes: 3
Views: 328
Reputation: 9544
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')
Upvotes: 0
Reputation: 4778
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')
Upvotes: 3