Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BigPipeStrategy.php

function BigPipeStrategy::processPlaceholders

Overrides PlaceholderStrategyInterface::processPlaceholders

File

core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php, line 108

Class

BigPipeStrategy
Defines the BigPipe placeholder strategy, to send HTML in chunks.

Namespace

Drupal\big_pipe\Render\Placeholder

Code

public function processPlaceholders(array $placeholders) {
    $request = $this->requestStack
        ->getCurrentRequest();
    // Prevent placeholders from being processed by BigPipe on uncacheable
    // request methods. For example, a form rendered inside a placeholder will
    // be rendered as soon as possible before any headers are sent, so that it
    // can be detected, submitted, and redirected immediately.
    // @todo https://www.drupal.org/node/2367555
    if (!$request->isMethodCacheable()) {
        return [];
    }
    // Routes can opt out from using the BigPipe HTML delivery technique.
    if ($this->routeMatch
        ->getRouteObject()
        ->getOption('_no_big_pipe')) {
        return [];
    }
    if (!$this->sessionConfiguration
        ->hasSession($request)) {
        return [];
    }
    return $this->doProcessPlaceholders($placeholders);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal