public function output(Response $response) { if ($response->getStatus()) { http_response_code($response->getStatus()); } if ($response->getHeaders()) { foreach ($response->getHeaders() as $k => $v) { if (!empty($v)) { header($k . ': ' . $v); } else { header($k); } } } if ($response->getCookies()) { foreach ($response->getCookies() as $k => $v) { setcookie($k, $v); } } $this->outputContent($response); }