/** * Terminates application. * * Renders content or excute redirecting * * @param Response $response */ public function terminate(Response $response) { if ($response->getRedirectUrl() === null) { header("Content-Type: {$response->getContentType()}; charset=utf-8"); http_response_code($response->getStatusCode()); $response->display(); } else { header("Location: {$response->getRedirectUrl()}"); } exit; }
/** * @brief display 调用模板,显示页面 * * @return void */ public function display($path) { Response::display($path, $this->theme); }