Welcome Guest, Not a member yet? Register   Sign In
Why use strings when doing rules for Form Validation instead of flags
#5

[eluser]ocdcoder[/eluser]
The "other frameworks" wasn't so much about validation in other PHP frameworks, but about frameworks dealing with "dynamic" parameters. jQuery, being js and not php, uses objects like: $.func({param1:val, param2:val}); I have also seen (and used by preference) php this way as well:

Code:
myFunc(array('param1'=>val, 'param2'=>val));

or (to put in form validation terms):

Code:
$this->form_validation->set_rules("email", "email", array('trim', 'required', 'valid_email'));

for example.

I guess I'm just not a big fan of playing with strings like they're arrays (even though they technically are, but you know what i'm talking about). Oh well, I may go modify the library later, but not right now. I was more just curious about the coding convention than anything else. Thanks for the replies!


Messages In This Thread
Why use strings when doing rules for Form Validation instead of flags - by El Forum - 02-09-2010, 12:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB