diff --git a/src/View/View.php b/src/View/View.php index 9dc82c9..507efef 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -108,4 +108,17 @@ public function __toString(): string { return $this->view; } -} \ No newline at end of file + + /** + * Redirect helper + * + * @param string $url + * @param integer $statusCode + * @return void + */ + public function redirect($url, $statusCode = 303) + { + header('Location: ' . $url, true, $statusCode); + exit(); + } +}