diff --git a/backend/app/Core/Response.php b/backend/app/Core/Response.php index bd4af8d..58c2af7 100644 --- a/backend/app/Core/Response.php +++ b/backend/app/Core/Response.php @@ -58,6 +58,25 @@ class Response exit; } + /** + * Send HTML response and terminate execution + * + * @param string $html + * @param int $code + * @return void + */ + public function html(string $html, int $code = 200): void + { + $this->setStatusCode($code); + $this->setHeader('Content-Type', 'text/html; charset=utf-8'); + + $this->sendHeaders(); + http_response_code($this->statusCode); + + echo $html; + exit; + } + /** * Send success JSON response */