05-17-2009, 04:15 PM
|
#3 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Salathe
Perhaps write another method which takes the variable and a list of checks.
PHP Code:
$val->check($username, 'empty', 'length');
|
Thanks, I'll look into doing it that way, and using optional arguments in the methods so they behave differently based on what's passed to them...
PHP Code:
$val->check($email, 'empty', 'email');
$val->check($username, 'empty', 'length', 'username');
$val->check($sex, 'empty', 'sex');
Hopefully what I typed above doesn't break any rules....
And hopefully the class method doesn't get too big and bloated looking...
|
|
|
|