JSON response object for AJAX requests.
Hierarchy
- class \Symfony\Component\HttpFoundation\JsonResponse extends \Symfony\Component\HttpFoundation\Response
- class \Drupal\Core\Ajax\AjaxResponse implements AttachmentsInterface uses AttachmentsTrait
Related topics
- Ajax API
- Overview for Drupal's Ajax API.
File
- core/lib/Drupal/Core/Ajax/AjaxResponse.php, line 15
Namespace
Drupal\Core\Ajax
Members
Name | Modifiers | Type | Description |
---|---|---|---|
AjaxResponse::$commands | protected | property | The array of ajax commands. |
AjaxResponse::addCommand | public | function | Add an AJAX command to the response. |
AjaxResponse::getCommands | public | function | Gets all AJAX commands. |
AttachmentsTrait::$attachments | protected | property | The attachments for this response. |
AttachmentsTrait::addAttachments | public | function | Adds attachments. Overrides AttachmentsInterface::addAttachments |
AttachmentsTrait::getAttachments | public | function | Gets attachments. Overrides AttachmentsInterface::getAttachments |
AttachmentsTrait::setAttachments | public | function | Sets attachments. Overrides AttachmentsInterface::setAttachments |
JsonResponse::$callback | protected | property | |
JsonResponse::$data | protected | property | |
JsonResponse::$encodingOptions | protected | property | |
JsonResponse::create | public static | function | |
JsonResponse::getEncodingOptions | public | function | Returns options used while encoding data to JSON. |
JsonResponse::setCallback | public | function | Sets the JSONP callback. |
JsonResponse::setData | public | function | Sets the data to be sent as JSON. |
JsonResponse::setEncodingOptions | public | function | Sets options used while encoding data to JSON. |
JsonResponse::update | protected | function | Updates the content and headers according to the JSON data and callback. |
JsonResponse::__construct | public | function | Constructor. |
Please login to continue.