Skip to content

Commit

Permalink
added status code for Route::redirect 🍺
Browse files Browse the repository at this point in the history
  • Loading branch information
Matix-Media committed Jul 28, 2020
1 parent ce256ec commit 3899c4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion requires/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ public static function load_view($view, $body_page = null, $title = null, $argum
}
}

public static function redirect($location)
public static function redirect($location, $status_code = 302)
{
// Set response code
http_response_code($status_code);
// Set header
header("Location: $location");
// Die, so no more content gets rendered
Expand Down

0 comments on commit 3899c4c

Please sign in to comment.