mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #2145 from tractorcow/3.1-controller-redirect
Controller::redirect now returns the resulting SS_HTTPResponse
This commit is contained in:
commit
7349682d44
@ -458,6 +458,8 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirect to the given URL.
|
* Redirect to the given URL.
|
||||||
|
*
|
||||||
|
* @return SS_HTTPResponse
|
||||||
*/
|
*/
|
||||||
public function redirect($url, $code=302) {
|
public function redirect($url, $code=302) {
|
||||||
if(!$this->response) $this->response = new SS_HTTPResponse();
|
if(!$this->response) $this->response = new SS_HTTPResponse();
|
||||||
@ -473,7 +475,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
|||||||
$url = Director::baseURL() . $url;
|
$url = Director::baseURL() . $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->response->redirect($url, $code);
|
return $this->response->redirect($url, $code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user