|
From: Shane <sh...@lo...> - 2004-12-17 12:54:48
|
What's the general concensus on checking and passing form data?
If you browse through slash-src, as well as 3rd party released code,
people do it many different ways. An example:
you have a form, and you create a pulldown in the form using
Slash.createSelect. it's passing back what's supposed to be an integer,
let's call it intID for simplicity's sake. In your perl script, you
eventually need to pass this intID to a method in your perl module.
So do you:
pass the entire $form
pass part of the form, $form->{intID}
where do you do the integer-validity check? or do you patch
Slash::Utility::Environment::filter_params and have it do the work for
you?
Obviously, a lot of this "just depends" on what you're coding for. But
considering that for everything I've ever coded for slash, I've done
all of the above at one time or another for one reason or another.
The biggest pain, for me, is having to patch Environment.pm to add my
vars to filter_params, so I often find that I don't bother with it, and
then forget about it.
I thought I might drum up some discussion, so let's see what y'all
think.
Shane
|