Skip to content

Commit 9f5cbc9

Browse files
Response::text
1 parent 1fdd532 commit 9f5cbc9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Router/Response.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ public static function html(string $data, $code = HTTP::SUCCESS) {
5555
die($data);
5656
}
5757

58+
public static function text(string $data, $code = HTTP::SUCCESS) {
59+
Header::status($code);
60+
!Header::sent() ? Header::html() : '';
61+
die($data);
62+
}
63+
5864
public static function svg(string $data, $code = HTTP::SUCCESS) {
5965
Header::type(Header::SVG);
6066
die($data);

0 commit comments

Comments
 (0)