You are here

public function PageController::view in Render cache 7.2

Parameters

array $objects:

Return value

array

Overrides BaseController::view

File

modules/controller/render_cache_page/src/RenderCache/Controller/PageController.php, line 30
Contains \Drupal\render_cache_page\RenderCache\Controller\PageController

Class

PageController
PageController - Provides render caching for page objects.

Namespace

Drupal\render_cache_page\RenderCache\Controller

Code

public function view(array $objects) {

  // We need to decrease recursion again.
  // Because this only adds to the recursion storage, it is safe to call.
  foreach ($objects as $id => $page) {

    // Transform into a render array.
    if (!is_array($page->content)) {
      $page->content = array(
        'main' => array(
          '#markup' => $page->content,
        ),
      );
    }
    $storage = $this->renderStack
      ->decreaseRecursion();
    $page->content['x_render_cache_page_recursion_storage'] = $storage;
  }
  return parent::view($objects);
}