Drupal 8  8.0.2
AjaxResponse Class Reference
Inheritance diagram for AjaxResponse:

Public Member Functions

 addCommand (CommandInterface $command, $prepend=FALSE)
 
getCommands ()
 
- Public Member Functions inherited from AttachmentsInterface
 getAttachments ()
 
 addAttachments (array $attachments)
 
 setAttachments (array $attachments)
 

Protected Attributes

 $commands = array()
 

Detailed Description

JSON response object for AJAX requests.

Member Function Documentation

addCommand ( CommandInterface  $command,
  $prepend = FALSE 
)

Add an AJAX command to the response.

Parameters
\Drupal\Core\Ajax\CommandInterface$commandAn AJAX command object implementing CommandInterface.
bool$prependA boolean which determines whether the new command should be executed before previously added commands. Defaults to FALSE.
Returns
AjaxResponse The current AjaxResponse.

References AttachmentsInterface\getAttachments(), BubbleableMetadata\mergeAttachments(), CommandInterface\render(), and AttachmentsInterface\setAttachments().

Referenced by AjaxResponseAttachmentsProcessor\buildAttachmentsCommands(), and ViewEditForm\rebuildCurrentTab().

Here is the call graph for this function:

Here is the caller graph for this function:

& getCommands ( )

Gets all AJAX commands.

Returns
[] Returns all previously added AJAX commands.

Referenced by AjaxResponseAttachmentsProcessor\buildAttachmentsCommands().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: