private function isAjax(ServerRequestInterface $request): bool
    {
        $params = $request->getServerParams();

        if (! array_key_exists('HTTP_X_REQUESTED_WITH', $params)) {

            return false;

        }

        return strtolower($params['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
    }
private function isAjax(ServerRequestInterface $request): bool
    {
        $params = $request->getServerParams();

        if (! array_key_exists('HTTP_X_REQUESTED_WITH', $params)) {

            return false;

        }

        return strtolower($params['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
    }
private function isAjax ( ServerRequestInterface $ request ) : bool { $ params = $ request -> getServerParams ( ) ; if ( ! array_key_exists ( 'HTTP_X_REQUESTED_WITH' , $ params ) ) { return false ; } return strtolower ( $ params [ 'HTTP_X_REQUESTED_WITH' ] ) == 'xmlhttprequest' ; }
Return whether the request is an ajax request.

@param \Psr\Http\Message\ServerRequestInterface $request
@return bool
Return whether the request is an ajax request .