A question about multiple models |
[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?
[eluser]Killswitch[/eluser]
Use this: https://github.com/jamierumbelow/codeigniter-base-model |
Welcome Guest, Not a member yet? Register Sign In |