protected function isXmlHttpRequest()
    {
        $serverParams = $this->getPsrRequest()->getServerParams();
        if(isset($serverParams['HTTP_X_REQUESTED_WITH'])){
            if(strtolower($serverParams['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
                return true;
            }
        }
        return false;
    }
protected function isXmlHttpRequest()
    {
        $serverParams = $this->getPsrRequest()->getServerParams();
        if(isset($serverParams['HTTP_X_REQUESTED_WITH'])){
            if(strtolower($serverParams['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
                return true;
            }
        }
        return false;
    }
protected function isXmlHttpRequest ( ) { $ serverParams = $ this -> getPsrRequest ( ) -> getServerParams ( ) ; if ( isset ( $ serverParams [ 'HTTP_X_REQUESTED_WITH' ] ) ) { if ( strtolower ( $ serverParams [ 'HTTP_X_REQUESTED_WITH' ] ) == 'xmlhttprequest' ) { return true ; } } return false ; }
Check if the current request is using AJAX

@return bool
Check if the current request is using AJAX