mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 07:22:13 +00:00
Merge pull request #70 from skipperbent/development
[FEATURE] Added http code to redirect method.
This commit is contained in:
@@ -19,8 +19,13 @@ class Response {
|
|||||||
* Redirect the response
|
* Redirect the response
|
||||||
*
|
*
|
||||||
* @param string $url
|
* @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);
|
$this->header('Location: ' . $url);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user