function BigPipe::filterResponse
Same name in other branches
- 9 core/modules/big_pipe/src/Render/BigPipe.php \Drupal\big_pipe\Render\BigPipe::filterResponse()
- 10 core/modules/big_pipe/src/Render/BigPipe.php \Drupal\big_pipe\Render\BigPipe::filterResponse()
- 11.x core/modules/big_pipe/src/Render/BigPipe.php \Drupal\big_pipe\Render\BigPipe::filterResponse()
Filters the given response.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request for which a response is being sent.
int $request_type: The request type. Can either be \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST or \Symfony\Component\HttpKernel\HttpKernelInterface::SUB_REQUEST.
\Symfony\Component\HttpFoundation\Response $response: The response to filter.
Return value
\Symfony\Component\HttpFoundation\Response The filtered response.
1 call to BigPipe::filterResponse()
- BigPipe::filterEmbeddedResponse in core/
modules/ big_pipe/ src/ Render/ BigPipe.php - Filters the given embedded response, using the cumulative AJAX page state.
File
-
core/
modules/ big_pipe/ src/ Render/ BigPipe.php, line 648
Class
- BigPipe
- Service for sending an HTML response in chunks (to get faster page loads).
Namespace
Drupal\big_pipe\RenderCode
protected function filterResponse(Request $request, $request_type, Response $response) {
assert($request_type === HttpKernelInterface::MASTER_REQUEST || $request_type === HttpKernelInterface::SUB_REQUEST);
$this->requestStack
->push($request);
$event = new FilterResponseEvent($this->httpKernel, $request, $request_type, $response);
$this->eventDispatcher
->dispatch(KernelEvents::RESPONSE, $event);
$filtered_response = $event->getResponse();
$this->requestStack
->pop();
return $filtered_response;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.