Simple Route
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
class Headers
|
||||
{
|
||||
public static function json()
|
||||
{
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
header("Content-Type: text/json");
|
||||
}
|
||||
|
||||
public static function html()
|
||||
{
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
}
|
||||
|
||||
public static function redirect(string $newUrl, bool $permanent = FALSE)
|
||||
{
|
||||
header('Location: ' . $newUrl, true, $permanent ? 301 : 303);
|
||||
|
||||
exit();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user