class JsAttachmentsProcessor in JS Callback Handler 8.3
Processes attachments of AJAX responses.
Hierarchy
- class \Drupal\Core\Ajax\AjaxResponseAttachmentsProcessor implements AttachmentsResponseProcessorInterface
- class \Drupal\js\JsAttachmentsProcessor
Expanded class hierarchy of JsAttachmentsProcessor
See also
\Drupal\Core\Ajax\AjaxResponse
\Drupal\Core\Render\MainContent\AjaxRenderer
1 string reference to 'JsAttachmentsProcessor'
1 service uses JsAttachmentsProcessor
File
- src/
JsAttachmentsProcessor.php, line 14
Namespace
Drupal\jsView source
class JsAttachmentsProcessor extends AjaxResponseAttachmentsProcessor {
/**
* {@inheritdoc}
*/
public function processAttachments(AttachmentsInterface $response) {
assert('$response instanceof \\Drupal\\js\\JsResponse');
/** @var \Drupal\js\JsResponse $response */
$data = $response
->getData();
if (!isset($data['commands'])) {
$data['commands'] = [];
}
$data['commands'] = array_merge($data['commands'], $this
->buildAttachmentsCommands($response, $this->requestStack
->getCurrentRequest()));
$response
->setData($data);
return $response;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AjaxResponseAttachmentsProcessor:: |
protected | property | The asset resolver service. | |
AjaxResponseAttachmentsProcessor:: |
protected | property | A config object for the system performance configuration. | |
AjaxResponseAttachmentsProcessor:: |
protected | property | The CSS asset collection renderer service. | |
AjaxResponseAttachmentsProcessor:: |
protected | property | The JS asset collection renderer service. | |
AjaxResponseAttachmentsProcessor:: |
protected | property | The module handler. | |
AjaxResponseAttachmentsProcessor:: |
protected | property | The renderer. | |
AjaxResponseAttachmentsProcessor:: |
protected | property | The request stack. | |
AjaxResponseAttachmentsProcessor:: |
protected | function | Prepares the AJAX commands to attach assets. | |
AjaxResponseAttachmentsProcessor:: |
public | function | Constructs a AjaxResponseAttachmentsProcessor object. | |
JsAttachmentsProcessor:: |
public | function |
Processes the attachments of a response that has attachments. Overrides AjaxResponseAttachmentsProcessor:: |