Wednesday, June 8, 2011

CodeIgniter 2.0+ is ajax check

Problem:
In some instances, you may want to know if your request in the controller was ajax.

Solution:
Turns out CodeIgniter has added an is_ajax_request method to the input class.

$this->input->is_ajax_request()

No comments: