Click to See Complete Forum and Search --> : Input validation object


tbach2
02-04-2004, 02:11 PM
This is a partial PHP port of the CPAN Data::formValidator (http://theoryx5.uwinnipeg.ca/CPAN/data/Data-FormValidator/Data/FormValidator.html#VALIDATING_INPUT) module. It has only a few of the options, but I figure its a good start.

The setup in your pages may seem a bit cumbersome at first, but I think you'll find that the way it lets you define constraints and dependencies makes it worth it.

The current setup lets you define
required variables
optional variables
variable dependencies
filters for the variables
constraints for the variables
The object makes available a list of
missing variables (required and dependencies)
invalid variables (failed their constraint)
filtered variables
valid variables
I'm looking for critique/ suggestions on
design and readability
code efficiency
code usefulness
any suggestions how to validate arrays in addition to scalar vars
Thanks :)