Skip to content
Derek Jones edited this page Jul 5, 2012 · 3 revisions

Category:Libraries::Extended add the methods you think are useful

class MY_User_agent extends CI_User_agent
{
    function MY_User_agent()
    {
       parent::CI_User_agent();
    }

    function is_xhr()
    {
        if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
             strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') 
        {
           return true;
        }
        else
        {
          return false;
        }
    }
}
Clone this wiki locally