[eluser]louis w[/eluser]
In some cases, I need my model to load another model and fetch some info before returning it all to the controller.
The name of the sub-model needs to be dynamic, as it will be coming from the db row.
This is the code I am trying in my model.
Code:
if (!is_object('$this->'.$module.'_model'))
$this->load->model($module.'_model');
$module_item = $this->{$module.'_model'}->getByID($row[$this->id_field]);
I get this error:
Message: Undefined property: A_model::$b_model (i changed the variable names)
This was developed under PHP5 and I do not care about backwards compatibility with 4.