[eluser]enrico.simonetti[/eluser]
Hi guys,
I’ve found this unexpected behavior in CI 1.7.2.
I have a model and from his constructor I need to load something (it can be a library or another model).
It will fail.
This is affected even when autoloading a model/library.
The constructor can either be '__construct' or the className method.
If I execute from inside the constructor something like:
$this->load->model('test_model');
$this->test_model->test('a','b','c');
It will fail with:
Fatal error: Call to a member function model() on a non-object...
If instead I write the same code inside any other method it works fine.
The aim is to load some libraries/models for the whole class, not just for a method.
A workaround can be to get an instance of CI and load the library/model with his aid.
Eg:
$this->ci =& get_instance();
$this->ci->load->model('test_model');
$this->ci->test_model->test('a','b','c');
Did you guys experience this issue yourself?
Thanks