Using models like in CodeIgniter

edited March 2011 in Modules
In my CodeIgniter projects I get the data from my database trough the model like this:

class Inhoud_model extends Model
{
function getInhoud($id)
{
$this->db->select('*');
$this->db->where("ID", $id);
$this->db->where("published", 1);
$this->db->from('Inhoud');

$query = $this->db->get();

if($query->num_rows() == 1)
{
return $query->result();
}
}

Then I import my model in the Controller like this: $this->load->model('Inhoud_model');

Why is this not working in Fuel CMS? Also when I extends MY_Model it's still not working.

Does this mean i've to change all my models to let this work?

Comments

  • edited 9:26AM
    What do you mean by not work? Is it throwing an error, or just not returning data etc? I'm not seeing anything immediately that would be a problem and something like that should work.
  • edited March 2011
    I got a server error. The page is not showing.
    HTTP Error 500
  • edited 9:26AM
    I got it. I don't know why but it's working now :)
Sign In or Register to comment.