[eluser]codebirth[/eluser]
Hello all!
I'm pretty new to CI so probably I'm missing something and this is a dumb question, but sincerely, I can't find what's wrong.
I have this controller
Code:
class Users extends Controller {
function index() {
$this->load->helper('form');
$data['main_content'] = $this->load->view('users', '', true);
$this->load->view('global', $data);
}
function login() {
$this->load->model('Login_model', TRUE);
if ($this->Login_model->user_exists($this->input->post('email', TRUE), md5($this->input->post('password', TRUE))))
$data['main_content'] = "ok";
else
$data['main_content'] = "error";
$this->load->view('global', $data);
}
}
and here is the model
Code:
class Login_model extends Model {
function Login_model()
{
parent::Model();
}
function user_exists($email, $password) {
return true;
}
}
When I try to login I get this error
Quote:Fatal error: Call to a member function user_exists() on a non-object
What I'm doing wrong? Any help will be appreciated.
codebirth