From 7340da03a710f205c291d64cf6b2078eb4ebe6bc Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 24 Jun 2013 13:39:05 +1200 Subject: [PATCH] Controller::redirect now returns the resulting SS_HTTPResponse, allowing the function to better support chaining --- control/Controller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/control/Controller.php b/control/Controller.php index b07c804c0..e66a6f3c9 100644 --- a/control/Controller.php +++ b/control/Controller.php @@ -458,6 +458,8 @@ class Controller extends RequestHandler implements TemplateGlobalProvider { /** * Redirect to the given URL. + * + * @return SS_HTTPResponse */ public function redirect($url, $code=302) { if(!$this->response) $this->response = new SS_HTTPResponse(); @@ -473,7 +475,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider { $url = Director::baseURL() . $url; } - $this->response->redirect($url, $code); + return $this->response->redirect($url, $code); } /**