This is the code that I'm running:
class Auth {
//put your code here
var $ci;
function __construct()
{
$this->ci =& get_instance();
$this->ci->load->library('session');
}
function Login($param)
{
// Get user from database
$this->ci->load->model('User_model');
$user = $this->ci->user_model->getuserbyemail($param["email"]);
(or at least the part that I'm running)
I'm getting the following error:
Fatal error: Call to a member function getuserbyemail() on a non-object in C:\Users\Piers\Documents\Projects\dithinsi\application\libraries\Auth.php on line 28
Line 28 is the the bottom line of the code above.
Is it because I'm not handling the $ci
variable properly?