public function CommentDeleteManager::isAjaxRequest in Comment Delete 8
Check if current request is Ajax.
Return value
bool A boolean indicating if current request is Ajax.
File
- src/
CommentDeleteManager.php, line 348
Class
- CommentDeleteManager
- Service container for comment delete operations.
Namespace
Drupal\comment_deleteCode
public function isAjaxRequest() {
$request = $this->requestStack
->getCurrentRequest();
$has_ajax_parameter = $request->request
->has(AjaxResponseSubscriber::AJAX_REQUEST_PARAMETER);
$has_ajax_format = $request->query
->get(MainContentViewSubscriber::WRAPPER_FORMAT) == 'drupal_ajax';
return $has_ajax_parameter || $has_ajax_format;
}