From cff0e96eaaca2f7b9ecf7375ac8297aabad01b67 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 27 May 2015 02:48:08 +0200 Subject: [PATCH] Implement helper method for redirecting --- src/Support/Action.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Support/Action.php b/src/Support/Action.php index 31599a950..b87fe9970 100644 --- a/src/Support/Action.php +++ b/src/Support/Action.php @@ -1,7 +1,8 @@ call($params); } + + /** + * @param string $url + * @return \Psr\Http\Message\ResponseInterface + */ + protected function redirectTo($url) + { + $content = sprintf(' + + + + + + Redirecting to %1$s + + + Redirecting to %1$s. + +', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')); + + return new Response($content, 302, ['location' => $url]); + } }