View Single Post
Old 05-17-2009, 04:15 PM   #3 (permalink)
allworknoplay
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
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...
allworknoplay is offline  
Reply With Quote