function BigPipe::filterEmbeddedResponse

Same name in other branches
  1. 9 core/modules/big_pipe/src/Render/BigPipe.php \Drupal\big_pipe\Render\BigPipe::filterEmbeddedResponse()
  2. 8.9.x core/modules/big_pipe/src/Render/BigPipe.php \Drupal\big_pipe\Render\BigPipe::filterEmbeddedResponse()
  3. 10 core/modules/big_pipe/src/Render/BigPipe.php \Drupal\big_pipe\Render\BigPipe::filterEmbeddedResponse()

Filters the given embedded response, using the cumulative AJAX page state.

Parameters

\Symfony\Component\HttpFoundation\Request $fake_request: A fake subrequest that contains the cumulative AJAX page state of the HTML document and all preceding Embedded HTML or AJAX responses.

\Symfony\Component\HttpFoundation\Response|\Drupal\Core\Render\HtmlResponse|\Drupal\Core\Ajax\AjaxResponse $embedded_response: Either an HTML response or an AJAX response that will be embedded in the overall HTML response.

Return value

\Symfony\Component\HttpFoundation\Response The filtered response, which will load only the assets that $fake_request did not indicate to already have been loaded, plus the updated cumulative AJAX page state.

3 calls to BigPipe::filterEmbeddedResponse()
BigPipe::sendNoJsPlaceholders in core/modules/big_pipe/src/Render/BigPipe.php
Sends no-JS BigPipe placeholders' replacements as embedded HTML responses.
BigPipe::sendPlaceholders in core/modules/big_pipe/src/Render/BigPipe.php
Sends BigPipe placeholders' replacements as embedded AJAX responses.
BigPipe::sendPreBody in core/modules/big_pipe/src/Render/BigPipe.php
Sends everything until just before </body>.

File

core/modules/big_pipe/src/Render/BigPipe.php, line 644

Class

BigPipe
Service for sending an HTML response in chunks (to get faster page loads).

Namespace

Drupal\big_pipe\Render

Code

protected function filterEmbeddedResponse(Request $fake_request, Response $embedded_response) {
    assert($embedded_response instanceof HtmlResponse || $embedded_response instanceof AjaxResponse);
    return $this->filterResponse($fake_request, HttpKernelInterface::SUB_REQUEST, $embedded_response);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.