protected function FragmentHandler::deliver in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/Fragment/FragmentHandler.php \Symfony\Component\HttpKernel\Fragment\FragmentHandler::deliver()
Delivers the Response as a string.
When the Response is a StreamedResponse, the content is streamed immediately instead of being returned.
Parameters
Response $response A Response instance:
Return value
string|null The Response content or null when the Response is streamed
Throws
\RuntimeException when the Response is not successful
1 call to FragmentHandler::deliver()
- FragmentHandler::render in vendor/
symfony/ http-kernel/ Fragment/ FragmentHandler.php - Renders a URI and returns the Response content.
File
- vendor/
symfony/ http-kernel/ Fragment/ FragmentHandler.php, line 133
Class
- FragmentHandler
- Renders a URI that represents a resource fragment.
Namespace
Symfony\Component\HttpKernel\FragmentCode
protected function deliver(Response $response) {
if (!$response
->isSuccessful()) {
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $this
->getRequest()
->getUri(), $response
->getStatusCode()));
}
if (!$response instanceof StreamedResponse) {
return $response
->getContent();
}
$response
->sendContent();
}