Skip to content

Commit

Permalink
* add function for check ajax request.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyidong committed Jul 1, 2015
1 parent 9538c89 commit b70dbad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions framework/helper.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,18 @@ public static function removeUTF8Bom($string)
return $string;
}

/**
* Check is ajax request.
*
* @static
* @access public
* @return bool
*/
public static function isAjaxRequest()
{
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
}

/**
* Set viewType.
*
Expand Down

0 comments on commit b70dbad

Please sign in to comment.