protected function BigPipe::sendChunk in Drupal 10
Same name and namespace in other branches
- 8 core/modules/big_pipe/src/Render/BigPipe.php \Drupal\big_pipe\Render\BigPipe::sendChunk()
- 9 core/modules/big_pipe/src/Render/BigPipe.php \Drupal\big_pipe\Render\BigPipe::sendChunk()
Sends a chunk.
Parameters
string|\Drupal\Core\Render\HtmlResponse $chunk: The string or response to append. String if there's no cacheability metadata or attachments to merge.
File
- core/
modules/ big_pipe/ src/ Render/ BigPipe.php, line 258
Class
- BigPipe
- Service for sending an HTML response in chunks (to get faster page loads).
Namespace
Drupal\big_pipe\RenderCode
protected function sendChunk($chunk) {
assert(is_string($chunk) || $chunk instanceof HtmlResponse);
if ($chunk instanceof HtmlResponse) {
print $chunk
->getContent();
}
else {
print $chunk;
}
flush();
}