[eluser]MadZad[/eluser]
A model isn't necessarily a one-trick pony - it can have many methods (functions). So, instead of the code you listed, your controller would first load the model (often in the constructor):
Code:
$this->load->model('My_model');
then call a function in the model when needed:
Code:
$myData = $this->My_model->gimme_some_data();
Therefore, your model would need that function:
Code:
class My_model extends Model {
function My_model() {
parent::Model();
}
function gimme_some_data () {
// assemble data in the $results array
return $results;
}
}