![]() |
Models in subdirectories - 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: Models in subdirectories (/showthread.php?tid=14720) |
Models in subdirectories - El Forum - 01-13-2009 [eluser]Kumar Chetan sharma[/eluser] Hi, Is it possible to put models inside a subdirectory? I am trying to do some thing like following: models/ models/mymodels/ models/mymodels/user.php {contains Model_user.php with class Model_user extends Model} controller/ controller/user.php with adduser method. Now how do I load the Model_user model? If I do Code: $this->load->model('User_model','', TRUE); Code: $this->load->model('mymodels/User_model','', TRUE); Models in subdirectories - El Forum - 01-13-2009 [eluser]xwero[/eluser] The file name should be the same as the class name. Or you have to load it like this Code: $this->load->model('mymodels/user','', TRUE); Models in subdirectories - El Forum - 01-13-2009 [eluser]Kumar Chetan sharma[/eluser] thanks a ton, it helped me :-) |