Welcome Guest, Not a member yet? Register   Sign In
Retrieving post data VS passing post data, in models
#1

[eluser]rossmurphy[/eluser]
What's the best way to get post data into a model.

I have been using $this->input->post() in my models. It this best practice? Or is it more acceptable to pass data into the method from the controller?

The only problem i see with the latter is when i have too much data to pass, makes passing data to the function kind of messy.

Any thoughts?

Thanks
#2

[eluser]Dam1an[/eluser]
It's best practice to not make any assumptions about where the data is coming from in the models, so I'd say pass it in from the controller. And if you're worries about having too many paramters, could always pass in an array instead




Theme © iAndrew 2016 - Forum software by © MyBB