class CacheableJsonResponse in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Cache/CacheableJsonResponse.php \Drupal\Core\Cache\CacheableJsonResponse
A JsonResponse that contains and can expose cacheability metadata.
Supports Drupal's caching concepts: cache tags for invalidation and cache contexts for variations.
Hierarchy
- class \Drupal\Core\Cache\CacheableJsonResponse extends \Symfony\Component\HttpFoundation\JsonResponse implements CacheableResponseInterface uses CacheableResponseTrait
Expanded class hierarchy of CacheableJsonResponse
See also
\Drupal\Core\Cache\CacheableMetadata
\Drupal\Core\Cache\CacheableResponseTrait
6 files declare their use of CacheableJsonResponse
- ExceptionHandlingTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Routing/ ExceptionHandlingTest.php - ExceptionJsonSubscriber.php in core/
lib/ Drupal/ Core/ EventSubscriber/ ExceptionJsonSubscriber.php - ExceptionJsonSubscriberTest.php in core/
tests/ Drupal/ Tests/ Core/ EventSubscriber/ ExceptionJsonSubscriberTest.php - JsonRenderer.php in core/
modules/ system/ tests/ modules/ common_test/ src/ Render/ MainContent/ JsonRenderer.php - PageCacheAcceptHeaderController.php in core/
modules/ system/ tests/ modules/ system_test/ src/ Controller/ PageCacheAcceptHeaderController.php
File
- core/
lib/ Drupal/ Core/ Cache/ CacheableJsonResponse.php, line 17
Namespace
Drupal\Core\CacheView source
class CacheableJsonResponse extends JsonResponse implements CacheableResponseInterface {
use CacheableResponseTrait;
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableResponseTrait:: |
protected | property | The cacheability metadata. | |
CacheableResponseTrait:: |
public | function | ||
CacheableResponseTrait:: |
public | function |