I am new to CodeIgniter
and specially RESTful
services. I am using Phil Sturgeon's RESTful API Server.
Now in examples there are no models and the response is shown on the initial view where all the links are.
But what I want is that I want to log the user in and if their credentials are okay then load a new view and send the data (response data) there.
This always gives me exceptions. Can someone explain what is happening>
My controller code:
function details_post()
{
$user_name = $this->post('username');
$pwd= $this->post('password');
echo $pwd;
if($pwd){
$this->load->model('login_model');
$result=$this->login_model->login($user_name,$pwd);
if($result){
$user_id=$this->session->userdata['logged_in']['userid'];
$this->load->model('loadposts_model');
//$data['response']=$this->response("ok", 200);
$data['query']=$this->loadposts_model->load_post($user_id);
$data['name'] = $result;
$this->load->view('CiscoGurus/user_newsfeed', $data);
//$this->response($data, 200);
}
if($result==false) {
$data['error_message'] = 'User name or password is incorrect!!!';
$this->load->view('CiscoGurus/index', $data);}
}
}