[SOLVED] 'Unable to locate file: mi_model.php' using HMVC - 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: [SOLVED] 'Unable to locate file: mi_model.php' using HMVC (/showthread.php?tid=31480) |
[SOLVED] 'Unable to locate file: mi_model.php' using HMVC - El Forum - 06-21-2010 [eluser]DooBie[/eluser] Hi, i am get same error when i try to view any page if a try to load a model in a controller class. I have this structure: Code: +app_SNR (application folder) Code in modules/usuarios/controllers/usuarios.php Code: class Usuarios extends Controller Code in modules/usuarios/models/usuarios_model.php Code: class Usuarios_model extends Model I put an example (sorry my poor english) If i go to http://miserver/usuarios i ger this error: Code: An Error Was Encountered BUT, if i put the usuarios_model.php file in 'app_SNR/models' AND put in 'autoload.php' Code: $autoload['model'] = array('Usuarios_model'); Code: ... WORK'S perfect! Where's my error? Thank you very much [SOLVED] 'Unable to locate file: mi_model.php' using HMVC - El Forum - 06-21-2010 [eluser]ivaylok[/eluser] The problem is that when you use CI's load->model method as you said, it is trying to locate the usuarios_model.php in your models folder, inside your application folder(so in your case it is trying to locate it in app_SNR/models/ ). So you should probably be extending CI's Loader library (you can do this unless using php4) and creating your own model function, that suits your folder structure. [SOLVED] 'Unable to locate file: mi_model.php' using HMVC - El Forum - 06-21-2010 [eluser]DooBie[/eluser] First of all, thanks, but, i use HMCV library, and in his documentation said the models folder in modules are viewing by the system, is not need to put the models in app_SNR/models. And second, if i put the file usuarios_model.php in app_SNR/models folder, i have the same error, only work if put in autoload.php file!!!! this is the problem! [SOLVED] 'Unable to locate file: mi_model.php' using HMVC - El Forum - 06-21-2010 [eluser]ivaylok[/eluser] Sorry, I misread about using HMVC. I am quite sure that you will find a solution for your problem if you take a look in this thread, or ask your question there. [SOLVED] 'Unable to locate file: mi_model.php' using HMVC - El Forum - 06-21-2010 [eluser]DooBie[/eluser] i solved my problem, the error are in this line in usuarios.php: Code: $this->load->model('Usuarios_model'); i change with this line: Code: $this->load->model('usuarios_model'); Note that 'usuarios_model' are in first lowercase! but, the name of the class are 'Usuarios_model' with first upercase. Thanks! [SOLVED] 'Unable to locate file: mi_model.php' using HMVC - El Forum - 08-18-2010 [eluser]Unknown[/eluser] Doobie muchas gracias! tu solución me sirvió para librarme del mismo error que me tenía loco desde hace 3 horas. --- Thank you Doobie! Your solution helped me to track the error. [SOLVED] 'Unable to locate file: mi_model.php' using HMVC - El Forum - 08-19-2010 [eluser]DooBie[/eluser] Me alegro haber sido de ayuda. [SOLVED] 'Unable to locate file: mi_model.php' using HMVC - El Forum - 11-02-2010 [eluser]gvillavizar[/eluser] Wow, a mi tambien me sirvio. Llevo un buen tiempo tratando de solucionar esto y no habia podido, increible que una simple letra mayuscula pudiera tenerme trancado por dos dias con el mismo error. Gracias! Edit: Ok, todavia no. Sigo teniendo el problema, estoy haciendo un clean install a ver si asi lo resuelvo. Edit: Efectivamente, eso resolvio mi error. Gracias. |