[eluser]asprillia[/eluser]
I try to load a model inside another model, but the model is not loaded in $this, but probably in $ci.
I've come up with this solution that seems more like a hack. How else can I solve this.
example:
Code:
<?
class MyModel extends Model {
function test() {
$this->load->model('Another_model');
$this->Another_model->insert();//$this->Another_model si not defined
$this->_assign_libraries();//now it is
$this->Another_model->insert();//works
//or
$ci = get_instance();
$ci->Another_model->insert();
}
}
Should "Another_model" be in the model object, since it lets me load it?