Welcome Guest, Not a member yet? Register   Sign In
Form validation not in controller but rather in Model
#1

[eluser]Ajaxian64[/eluser]
Hi all,

just a very simple question (maybe stupid, but I try...)

Must we put the form_validation in a controller's method or could we put it in a model class ?
I mean, till now I do this kind of things:
I have a form, in the form the action on submit call a controller method in which we can check the post data.

But I'm in a case where this kind of design is weak, moreover dealing with data checking in a controller is not perhaps the good manner to do.

Then does it work if In my controller method I call $this->my_model->checkData(list of data posted)
HoweverI wonder also what appear for the error message displaying with the form_validation (I load it in the model)
Thanks for your help


Messages In This Thread
Form validation not in controller but rather in Model - by El Forum - 08-06-2010, 10:58 AM
Form validation not in controller but rather in Model - by El Forum - 08-06-2010, 10:04 PM
Form validation not in controller but rather in Model - by El Forum - 08-07-2010, 01:05 AM
Form validation not in controller but rather in Model - by El Forum - 08-07-2010, 03:01 AM
Form validation not in controller but rather in Model - by El Forum - 08-07-2010, 03:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB