class ViewAjaxResponse in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/src/Ajax/ViewAjaxResponse.php \Drupal\views\Ajax\ViewAjaxResponse
Custom JSON response object for an ajax view response.
We use a special response object to be able to fire a proper alter hook.
Hierarchy
- class \Drupal\Core\Ajax\AjaxResponse extends \Symfony\Component\HttpFoundation\JsonResponse implements AttachmentsInterface uses AttachmentsTrait
- class \Drupal\views\Ajax\ViewAjaxResponse
Expanded class hierarchy of ViewAjaxResponse
2 files declare their use of ViewAjaxResponse
- ViewAjaxController.php in core/
modules/ views/ src/ Controller/ ViewAjaxController.php - ViewAjaxControllerTest.php in core/
modules/ views/ tests/ src/ Unit/ Controller/ ViewAjaxControllerTest.php
File
- core/
modules/ views/ src/ Ajax/ ViewAjaxResponse.php, line 13
Namespace
Drupal\views\AjaxView source
class ViewAjaxResponse extends AjaxResponse {
/**
* The view executed on this ajax request.
*
* @var \Drupal\views\ViewExecutable
*/
protected $view;
/**
* Sets the executed view of this response.
*
* @param \Drupal\views\ViewExecutable $view
* The View executed on this ajax request.
*/
public function setView(ViewExecutable $view) {
$this->view = $view;
}
/**
* Gets the executed view of this response.
*
* @return \Drupal\views\ViewExecutable
* The View executed on this ajax request.
*/
public function getView() {
return $this->view;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AjaxResponse:: |
protected | property | The array of ajax commands. | |
AjaxResponse:: |
public | function | Add an AJAX command to the response. | |
AjaxResponse:: |
public | function | Gets all AJAX commands. | |
AttachmentsTrait:: |
protected | property | The attachments for this response. | |
AttachmentsTrait:: |
public | function | ||
AttachmentsTrait:: |
public | function | ||
AttachmentsTrait:: |
public | function | ||
ViewAjaxResponse:: |
protected | property | The view executed on this ajax request. | |
ViewAjaxResponse:: |
public | function | Gets the executed view of this response. | |
ViewAjaxResponse:: |
public | function | Sets the executed view of this response. |