public AttachmentsResponseProcessorInterface::processAttachments(AttachmentsInterface $response)
Processes the attachments of a response that has attachments.
Libraries, JavaScript settings, feeds, HTML <head> tags, HTML <head> links, HTTP headers, and the HTTP status code are attached to render arrays using the #attached property. The #attached property is an associative array, where the keys are the attachment types and the values are the attached data. For example:
$build['#attached']['library'][] = [ 'library' => ['core/jquery'] ]; $build['#attached']['http_header'] = [ ['Content-Type', 'application/rss+xml; charset=utf-8'], ];
The available keys are:
\Drupal\Core\Render\AttachmentsInterface $response: The response to process.
\Drupal\Core\Render\AttachmentsInterface The processed response, with the attachments updated to reflect their final values.
\InvalidArgumentException Thrown when the $response parameter is not the type of response object the processor expects.
public function processAttachments(AttachmentsInterface $response);
© 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!Render!AttachmentsResponseProcessorInterface.php/function/AttachmentsResponseProcessorInterface::processAttachments/8.1.x