src/Control/Director.php
public static function is_ajax(HTTPRequest $request = null)
    {
        $request = self::currentRequest($request);
        if ($request) {
            return $request->isAjax();
        }

        return (
            isset($_REQUEST['ajax']) ||
            (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == "XMLHttpRequest")
        );
    }
public static function is_ajax(HTTPRequest $request = null)
    {
        $request = self::currentRequest($request);
        if ($request) {
            return $request->isAjax();
        }

        return (
            isset($_REQUEST['ajax']) ||
            (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == "XMLHttpRequest")
        );
    }
public static function is_ajax ( HTTPRequest $ request = null ) { $ request = self :: currentRequest ( $ request ) ; if ( $ request ) { return $ request -> isAjax ( ) ; } return ( isset ( $ _REQUEST [ 'ajax' ] ) || ( isset ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) && $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] == "XMLHttpRequest" ) ) ; }
Checks if the current HTTP-Request is an "Ajax-Request" by checking for a custom header set by
jQuery or whether a manually set request-parameter 'ajax' is present.

Note that if you plan to use this to alter your HTTP response on a cached page,
you should add X-Requested-With to the Vary header.

@param HTTPRequest $request
@return bool
Checks if the current HTTP - Request is an Ajax - Request by checking for a custom header set by jQuery or whether a manually set request - parameter ajax is present .