From 68a243f9cfbd1ea6dbb81b95551deaf142fd3378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 30 Oct 2020 10:53:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Http/Response.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/HttpServer/Http/Response.php b/HttpServer/Http/Response.php index 1d2d14dc..6ad2a412 100644 --- a/HttpServer/Http/Response.php +++ b/HttpServer/Http/Response.php @@ -84,6 +84,40 @@ class Response extends Application } } + + /** + * @param $content + * @return mixed + */ + public function toHtml($content) + { + $this->format = self::HTML; + return $content; + } + + + /** + * @param $content + * @return mixed + */ + public function toJson($content) + { + $this->format = self::JSON; + return $content; + } + + + /** + * @param $content + * @return mixed + */ + public function toXml($content) + { + $this->format = self::XML; + return $content; + } + + /** * @return mixed * @throws Exception