public render ( |
||
$response | ||
Résultat |
public function render(Response $response)
{
if ($this->showBar === false) {
return $response;
}
$statusCode = $response->getStatusCode();
if ($this->deny($response, $statusCode) === true) {
return $response;
}
$content = $response->getContent();
$htmlValidatorPanel = $this->getPanel('html-validator');
if (is_null($htmlValidatorPanel) === false && $statusCode === 200) {
$htmlValidatorPanel->setHtml($content);
}
$bar = $this->getBar();
$pos = strripos($content, '</body>');
if ($pos !== false) {
$content = substr($content, 0, $pos) . $bar . substr($content, $pos);
} else {
$content .= $bar;
}
$response->setContent($content);
return $response;
}
/** * dispatchContent. * * @method dispatchContent * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return \Symfony\Component\HttpFoundation\Response */ protected function dispatchContent($request, $next) { $this->storeWrapper->start(); $this->debugbar->dispatchContent(); $response = $this->debugbar->render($next($request)); $this->storeWrapper->store()->close(); return $response; }