You are here

protected function DynamicPageCacheSubscriber::renderArrayToResponse in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::renderArrayToResponse()
  2. 9 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\EventSubscriber

Code

protected function renderArrayToResponse(array $render_array) {
  return $render_array['#response'];
}