CodeIgniter Forums
Loading a Model Twice - 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: Loading a Model Twice (/showthread.php?tid=20909)



Loading a Model Twice - El Forum - 07-25-2009

[eluser]saidai jagan[/eluser]
Hi i loaded a model in the constructor and also in the function.Whether the model loads twice? or CI automatically enables one Time ?.
Thanks.


Loading a Model Twice - El Forum - 07-25-2009

[eluser]davidbehler[/eluser]
Look at your log file, CI will report that the module is already loaded and will not load it a second time.


Loading a Model Twice - El Forum - 07-25-2009

[eluser]saidai jagan[/eluser]
Thanks for u r reply Smile
were to c the log file ?.
Is that model will not be loaded Twice ?


Loading a Model Twice - El Forum - 07-25-2009

[eluser]davidbehler[/eluser]
Log file should be in 'system/logs' as long as that directory is writable and logging is enabled.

Apart from that CI is pretty smart and does not load libraries, models twice.

But why do you load in your function anyway if you already load it in the constructor?


Loading a Model Twice - El Forum - 07-25-2009

[eluser]saidai jagan[/eluser]
Thanks fa u r replys.
Now i ll remove the models