You are here

protected function DynamicPageCacheSubscriber::renderArrayToResponse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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::onRouteMatch 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 306
Contains \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber.

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'];
}