Voodoo\Core\Http\Request::isAjax PHP Method

isAjax() public static method

Verify is the access is from ajax.
public static isAjax ( ) : boolean
return boolean
    public static function isAjax()
    {
        return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == "xmlhttprequest" ? true : false;
    }

Usage Example

示例#1
0
 /**
  * CHeck request if it's an ajax request
  * @return bool
  */
 public function isAjax()
 {
     return Http\Request::isAjax();
 }