Object Programming with CodeIgniter |
Sounds like you came up with a pretty good solution in the end.
![]() I have become a huge fan of Composer. To handle the situations like yours, I would enable Composer in CodeIgniter's config file Code: $config['composer_autoload'] = TRUE;[/url] Then, I would make that User class, still located in application/libraries, to have a namespace of App\Libraries. Code: <?php namespace App\Libraries; Then, in your other classes all you have to do is create a new User object. Code: $user = new App\Libraries\User( $this->user_model ); Something like that anyway. I'm still revising my tasks to be easier for testing, but I believe that would all work. While I probably went overboard there, hopefully you see the main point of using Composer as an autoloader. ![]() |
Messages In This Thread |
Object Programming with CodeIgniter - by _this - 04-27-2015, 11:48 PM
RE: Object Programming with CodeIgniter - by Vimal - 04-28-2015, 12:57 AM
RE: Object Programming with CodeIgniter - by _this - 04-28-2015, 05:46 AM
RE: Object Programming with CodeIgniter - by kilishan - 04-28-2015, 07:27 AM
RE: Object Programming with CodeIgniter - by Vimal - 04-29-2015, 03:23 AM
|