![]() |
A question about multiple models - 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: A question about multiple models (/showthread.php?tid=58723) |
A question about multiple models - El Forum - 07-12-2013 [eluser]Unknown[/eluser] Welcome everybody, I'm new here. I have one question about models and DRY. I have few tables in my MySQL database (news, clients etc.) and for each table I have one model (news_model, clients_model, etc.) and I'm using CI ActiveRecord- my problem is that in most of them I need CRUD methods and... well they just look the same. It is good? Or should I create some sort of helpers? This is my code, to show what I want to say: This is my add method in page_model: Code: public function add($title, $add_date, $content) And this is my add method in news_model: Code: public function submit($add_date, $title, $content) Looks nearly the same and I'm pretty sure that this is wrong way to do it or is not? Should I create some sort of helpers or something else? A question about multiple models - El Forum - 07-13-2013 [eluser]Killswitch[/eluser] Use this: https://github.com/jamierumbelow/codeigniter-base-model |