From 87c4a96641e1873beb68076584926b9884f418ae Mon Sep 17 00:00:00 2001 From: Braunson Yager Date: Fri, 8 Oct 2021 00:39:43 -0400 Subject: [PATCH] Added redirect helper as per #144 https://github.com/avolutions/avolutions/issues/144 --- src/View/View.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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(); + } +}