class CacheableJsonResponse
Same name in other branches
- 9 core/lib/Drupal/Core/Cache/CacheableJsonResponse.php \Drupal\Core\Cache\CacheableJsonResponse
- 10 core/lib/Drupal/Core/Cache/CacheableJsonResponse.php \Drupal\Core\Cache\CacheableJsonResponse
- 11.x 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 \Drupal\Core\Cache\CacheableResponseInterface uses \Drupal\Core\Cache\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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.