interface AttachmentsInterface in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Render/AttachmentsInterface.php \Drupal\Core\Render\AttachmentsInterface
- 9 core/lib/Drupal/Core/Render/AttachmentsInterface.php \Drupal\Core\Render\AttachmentsInterface
Defines an interface for responses that can expose #attached metadata.
@todo If in Drupal 9, we remove attachments other than assets (libraries + drupalSettings), then we can look into unifying this with \Drupal\Core\Asset\AttachedAssetsInterface.
Hierarchy
- interface \Drupal\Core\Render\AttachmentsInterface
Expanded class hierarchy of AttachmentsInterface
All classes that implement AttachmentsInterface
See also
\Drupal\Core\Render\AttachmentsTrait
11 files declare their use of AttachmentsInterface
- AjaxResponse.php in core/
lib/ Drupal/ Core/ Ajax/ AjaxResponse.php - AjaxResponseAttachmentsProcessor.php in core/
lib/ Drupal/ Core/ Ajax/ AjaxResponseAttachmentsProcessor.php - AttachmentsTestDomainObject.php in core/
modules/ system/ tests/ modules/ early_rendering_controller_test/ src/ AttachmentsTestDomainObject.php - AttachmentsTestResponse.php in core/
modules/ system/ tests/ modules/ early_rendering_controller_test/ src/ AttachmentsTestResponse.php - BigPipeResponseAttachmentsProcessor.php in core/
modules/ big_pipe/ src/ Render/ BigPipeResponseAttachmentsProcessor.php
File
- core/
lib/ Drupal/ Core/ Render/ AttachmentsInterface.php, line 14
Namespace
Drupal\Core\RenderView source
interface AttachmentsInterface {
/**
* Gets attachments.
*
* @return array
* The attachments.
*/
public function getAttachments();
/**
* Adds attachments.
*
* @param array $attachments
* The attachments to add.
*
* @return $this
*/
public function addAttachments(array $attachments);
/**
* Sets attachments.
*
* @param array $attachments
* The attachments to set.
*
* @return $this
*/
public function setAttachments(array $attachments);
}