• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.