mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-16 02:30:09 +03:00
[TASK] Added http code to redirect method.
This commit is contained in:
@@ -19,8 +19,13 @@ class Response {
|
||||
* Redirect the response
|
||||
*
|
||||
* @param string $url
|
||||
* @param int $httpCode
|
||||
*/
|
||||
public function redirect($url) {
|
||||
public function redirect($url, $httpCode = null) {
|
||||
if($httpCode !== null) {
|
||||
$this->httpCode($httpCode);
|
||||
}
|
||||
|
||||
$this->header('Location: ' . $url);
|
||||
die();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user