Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

What to return in controller

$
0
0
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.

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>