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:
Is it good to return false or return other value?
Thank you.
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.