W3cubDocs

/Drupal 8

class AjaxResponse

JSON response object for AJAX requests.

Hierarchy

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.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Ajax!AjaxResponse.php/class/AjaxResponse/8.1.x