[eluser]jurosik[/eluser]
Maybe I should write more...
I had one big model with all functions, but now i need to make this model more comprendious, so i allocate my functions into tematic models. but functions have calls between models.
I need to load model once, and then just call them anywhere in model...
Code:
model1
load model2 (model3, 4...)
function1() {
model2->function2()
}
i have tried this:
Code:
class Data_model extends Model {
function Data_model()
{
parent::Model();
$this->CI =& get_instance();
$this->CI->load->model('main_model');
$this->CI->load->model('file_model');
}
...
$this->CI->main_model->getSomething($value);
But when i load file Data_model in Main_model (here is function 1 which i am calling from Data_model) it doesn't work
Code:
class Main_model extends Model {
function Main_model()
{
parent::Model();
$this->CI =& get_instance();
$this->CI->load->model('data_model');
$this->CI->load->model('file_model');
}
function getSomething($value)
{
return $value;
}
}
mybe it's very complicated to explain...