Model concept question |
Why re-invent the wheel?
Avenirer has developed a great MY_Model class: https://github.com/avenirer/CodeIgniter-MY_Model You must put the MY_Model.php file in the application/core folder. Then, create your own model in application/models and extend the MY_Model class. Like this: PHP Code: class User_model extends MY_Model { With minimal setup, you can use the built-in functions of MY_Model. Example: PHP Code: $this->load->model('user_model'); It even works with method chaining: PHP Code: $users = $this->user_model->where('city','London')->order_by('address', 'ASC')->get_all(); |
Messages In This Thread |
Model concept question - by meSmashsta - 01-15-2017, 10:16 PM
RE: Model concept question - by venkat - 01-15-2017, 10:27 PM
RE: Model concept question - by meSmashsta - 01-15-2017, 10:40 PM
RE: Model concept question - by venkat - 01-16-2017, 12:40 AM
RE: Model concept question - by meSmashsta - 01-16-2017, 01:09 AM
RE: Model concept question - by venkat - 01-16-2017, 02:00 AM
RE: Model concept question - by meSmashsta - 01-16-2017, 02:20 AM
RE: Model concept question - by InsiteFX - 01-16-2017, 05:50 AM
RE: Model concept question - by Wouter60 - 01-16-2017, 09:04 AM
RE: Model concept question - by meSmashsta - 01-17-2017, 04:06 AM
RE: Model concept question - by InsiteFX - 01-17-2017, 04:47 AM
|