Welcome Guest, Not a member yet? Register   Sign In
How to know if a model is already loaded?
#4

[eluser]abedzilla[/eluser]
You can use the log_message() function and put it in the constructor, so it will be executed when it initiated

Put this in your model's constructor (parent::Model())

Code:
log_message ("debug", "Yourmodel is loaded");

don't forget to set the log config to debug mode, see the config.php file

Code:
$config['log_threshold'] = 2;

And set the system/logs directory permission to writable (by default CI will create the log files here)

or set the logs directory in another dir
Code:
$config['log_path'] = 'another/directory/logs/';

CI will then create the log file in the directory. monitor the log files as you like. You can get the debug message to see if your model is already loaded or not in the log files.


Messages In This Thread
How to know if a model is already loaded? - by El Forum - 02-10-2011, 10:00 AM
How to know if a model is already loaded? - by El Forum - 02-11-2011, 04:36 AM
How to know if a model is already loaded? - by El Forum - 02-11-2011, 05:25 AM
How to know if a model is already loaded? - by El Forum - 02-11-2011, 04:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB