mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Added Controller->getRequest()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63653 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d53bbb0df1
commit
52ae575630
@ -31,10 +31,17 @@ class Controller extends RequestHandlingData {
|
|||||||
protected $basicAuthEnabled = true;
|
protected $basicAuthEnabled = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The HTTPResponse object that the controller returns
|
* @var HTTPResponse $response The response object that the controller returns.
|
||||||
|
* Set in {@link handleRequest()}.
|
||||||
*/
|
*/
|
||||||
protected $response;
|
protected $response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var HTTPRequest $request The request object that the controller was called with.
|
||||||
|
* Set in {@link handleRequest()}. Useful to generate the {}
|
||||||
|
*/
|
||||||
|
protected $request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default URL handlers - (Action)/(ID)/(OtherID)
|
* Default URL handlers - (Action)/(ID)/(OtherID)
|
||||||
*/
|
*/
|
||||||
@ -60,6 +67,7 @@ class Controller extends RequestHandlingData {
|
|||||||
|
|
||||||
$this->pushCurrent();
|
$this->pushCurrent();
|
||||||
$this->urlParams = $request->allParams();
|
$this->urlParams = $request->allParams();
|
||||||
|
$this->request = $request;
|
||||||
$this->response = new HTTPResponse();
|
$this->response = new HTTPResponse();
|
||||||
|
|
||||||
// Init
|
// Init
|
||||||
@ -151,6 +159,16 @@ class Controller extends RequestHandlingData {
|
|||||||
function getResponse() {
|
function getResponse() {
|
||||||
return $this->response;
|
return $this->response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the request with which this controller was called (if any).
|
||||||
|
* Usually set in {@link handleRequest()}.
|
||||||
|
*
|
||||||
|
* @return HTTPRequest
|
||||||
|
*/
|
||||||
|
function getRequest() {
|
||||||
|
return $this->request;
|
||||||
|
}
|
||||||
|
|
||||||
protected $baseInitCalled = false;
|
protected $baseInitCalled = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user