mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Controller::redirect now returns the resulting SS_HTTPResponse, allowing the function to better support chaining
This commit is contained in:
parent
b0e359ddb7
commit
7340da03a7
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user