Welcome Guest, Not a member yet? Register   Sign In
Problems with models calling other models
#8

[eluser]xwero[/eluser]
I think if they really want to do it they should do it in the controller instead of obscuring the loading of the model inside the other model.
Code:
// model
function method()
{
    $ci =& get_instance();
    $ci->load->model('other_model');
    $output = $ci->other_model->method();
    // more output
    return $output;
}
// controller
function method
$this->load->model(array('model_one','model_two'));
$data['view'] = $this->model_one->method($this->model_two->method());
If they see then how much code it needs they will look for other solutions like the joined query.


Messages In This Thread
Problems with models calling other models - by El Forum - 04-06-2009, 12:35 AM
Problems with models calling other models - by El Forum - 04-06-2009, 01:28 AM
Problems with models calling other models - by El Forum - 04-06-2009, 02:34 AM
Problems with models calling other models - by El Forum - 04-06-2009, 02:43 AM
Problems with models calling other models - by El Forum - 04-06-2009, 02:58 AM
Problems with models calling other models - by El Forum - 04-06-2009, 03:28 AM
Problems with models calling other models - by El Forum - 04-06-2009, 04:32 AM
Problems with models calling other models - by El Forum - 04-06-2009, 04:45 AM
Problems with models calling other models - by El Forum - 04-06-2009, 06:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB