Welcome Guest, Not a member yet? Register   Sign In
Validation callback function inside model
#6

[eluser]gtech[/eluser]
Quote:I’m using the standard validation.php and all proccess of validating the form and adding info to the database is stored in model, i didn’t want to have validation inside controller.. My controller just calls Model’s method register() which returns false if something went wrong and registration didn’t go well and true if everything’s OK. Then the controller desides what to show - the form again or success message.

After reading the validation code, I think the validation library works on the assumption you validate the form BEFORE you pass the data to a model (it tends to be standard practice). I am not convinced it will work the way you want it to .. sorry.., you could try passing the POST data down to the model.

[edit] Use the callback code in post below, it will achieve what you want.


Messages In This Thread
Validation callback function inside model - by El Forum - 11-06-2007, 04:13 AM
Validation callback function inside model - by El Forum - 11-06-2007, 04:36 AM
Validation callback function inside model - by El Forum - 11-06-2007, 05:16 AM
Validation callback function inside model - by El Forum - 11-06-2007, 05:26 AM
Validation callback function inside model - by El Forum - 11-06-2007, 05:35 AM
Validation callback function inside model - by El Forum - 11-06-2007, 05:48 AM
Validation callback function inside model - by El Forum - 11-06-2007, 05:55 AM
Validation callback function inside model - by El Forum - 11-06-2007, 06:10 AM
Validation callback function inside model - by El Forum - 11-06-2007, 06:39 AM
Validation callback function inside model - by El Forum - 11-06-2007, 07:03 AM
Validation callback function inside model - by El Forum - 11-06-2007, 07:13 AM
Validation callback function inside model - by El Forum - 11-06-2007, 07:37 AM
Validation callback function inside model - by El Forum - 11-06-2007, 07:39 AM
Validation callback function inside model - by El Forum - 11-06-2007, 07:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB