![]() |
How much should models do? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: How much should models do? (/showthread.php?tid=38855) |
How much should models do? - El Forum - 02-21-2011 [eluser]brainer[/eluser] Hi, I'm about to re-write a CI app of mine. In the current version - pretty much all my models do is interact with the database. i.e. here is a typical (yet simple) example of a current model: Code: class User_model extends Model { However I have read a lot that models should take care of all 'Business Logic'. I guess I'm kind of confused as to what exactly 'Business Logic' is. For instance in my controller I currently fetch data from the model and process that data there in the controller. For example: Code: $user = $this->user_model->get(1); I know that CI is flexible enough for me to do whatever I want wherever I want, but it seems to me that using models just for database interaction is pretty pointless. Should I be processing the 'age' and 'avatar' in my model? Just wondering how all of you use your models. |