Welcome Guest, Not a member yet? Register   Sign In
What to return in controller
#1

Hello.
I would like to ask, what to return in controller if I am expecting XMLHttpRequest but request is not XMLHttpRequest.
I have something like this:


Code:
public function show_post($id)
{
 if (!$this->input->is_ajax_request())
   return false;
 ...
 $data = $this->some_model->post($id);
 return json_encode($data);
}

Is it good to return false or return other value?
Thank you.
Reply


Messages In This Thread
What to return in controller - by romankubis - 10-18-2017, 12:39 AM
RE: What to return in controller - by dave friend - 10-18-2017, 07:48 AM
RE: What to return in controller - by romankubis - 10-18-2017, 09:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB