[eluser]jloosli[/eluser]
I'm sure this is something simple that I'm overlooking, but after hours of troubleshooting and web searches, I can't figure this out.
I have a model called Units that looks like this:
Code:
class Units extends Model {
function __construct() {
parent::__construct();
}
function getActive() {
$this->db->where('u_active','y');
$this->db->order_by('u_name','asc');
$result=$this->db->get('units')->result();
return $result;
}
}
I've used $this->units->getActive() successfully in other views, but I created a new view this morning and have the following code in it:
Code:
$this->load->model('units');
$units=$this->units->getActive(); //This is line 12
I get the following CI error: Undefined property: CI_Loader::$units
as well as the PHP Error:
Fatal error: Call to a member function getActive() on a non-object in C:\xampp\htdocs\ci\system\application\views\invoice.php on line 12
I'm pretty sure that the model is loading, because I commented out line 12, enabled the profiler, and saw the memory usage change when I commented out the line to load the model.
So...I'm stumped. Any idea why I can't see this method in this view?