protected function DynamicPageCacheSubscriber::renderArrayToResponse in Drupal 9
Same name and namespace in other branches
- 8 core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::renderArrayToResponse()
- 10 core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::renderArrayToResponse()
Gets the embedded Response object in a render array.
Parameters
array $render_array: A render array with a #response property.
Return value
\Drupal\Core\Cache\CacheableResponseInterface The cacheable response object.
See also
responseToRenderArray()
1 call to DynamicPageCacheSubscriber::renderArrayToResponse()
- DynamicPageCacheSubscriber::onRequest in core/
modules/ dynamic_page_cache/ src/ EventSubscriber/ DynamicPageCacheSubscriber.php - Sets a response in case of a Dynamic Page Cache hit.
File
- core/
modules/ dynamic_page_cache/ src/ EventSubscriber/ DynamicPageCacheSubscriber.php, line 300
Class
- DynamicPageCacheSubscriber
- Returns cached responses as early and avoiding as much work as possible.
Namespace
Drupal\dynamic_page_cache\EventSubscriberCode
protected function renderArrayToResponse(array $render_array) {
return $render_array['#response'];
}