![]() |
Question about Models and Libraries - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Question about Models and Libraries (/showthread.php?tid=23717) |
Question about Models and Libraries - El Forum - 10-20-2009 [eluser]gedev2006[/eluser] Hi The model and library loader is quite annoying really. Lets say i have a model, called "customers". It may look like this: Code: Class Customers extends Model { as you can see what i want to do is return an array of "customer" objects. Where the customer class is a custom class maybe like this: Code: class Customer { now the only way i can see to do this is to have the Customer class underneith or above the model in the same file. I did think about creating it as a library, but thince $this->load->library ( 'customer', array ( $customer ) ); would not return the object of the Library, i cannot create the $_customer array. Any ideas? Question about Models and Libraries - El Forum - 10-20-2009 [eluser]Jeffrey Lasut[/eluser] If I were you I would take a look at DMZ/datamapper: http://ellislab.com/forums/viewthread/112904/ |