public function isAjax()
    {
        if ($this->headers->get('HTTP_X_REQUESTED_WITH') !== null
            && strtolower($this->headers->get('HTTP_X_REQUESTED_WITH')) === 'xmlhttprequest'
        ) {
            return true;
        }
        return false;
    }