[TASK] Added http code to redirect method.

This commit is contained in:
Simon Sessingø
2016-03-14 01:00:19 +01:00
parent 115c8e510a
commit a92b6008fa

View File

@@ -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();
}