本文整理汇总了PHP中HTTPRequest::allParams方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTPRequest::allParams方法的具体用法?PHP HTTPRequest::allParams怎么用?PHP HTTPRequest::allParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPRequest
的用法示例。
在下文中一共展示了HTTPRequest::allParams方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Show a report based on the URL query string.
*
* @param HTTPRequest $request The HTTP request object
*/
public function show($request)
{
$params = $request->allParams();
return $this->showWithEditForm($params, $this->reportEditFormFor($params['ID']));
}
示例2: handleRequest
/**
* Handles HTTP requests.
*
* If you are going to overload handleRequest, make sure that you start the method with $this->pushCurrent()
* and end the method with $this->popCurrent(). Failure to do this will create weird session errors.
*
* @param $request The {@link HTTPRequest} object that is responsible for distributing request parsing.
*/
function handleRequest(HTTPRequest $request) {
if(!$request) user_error("Controller::handleRequest() not passed a request!", E_USER_ERROR);
$this->pushCurrent();
$this->urlParams = $request->allParams();
$this->request = $request;
$this->response = new HTTPResponse();
// Init
$this->baseInitCalled = false;
$this->init();
if(!$this->baseInitCalled) user_error("init() method on class '$this->class' doesn't call Controller::init(). Make sure that you have parent::init() included.", E_USER_WARNING);
// If we had a redirection or something, halt processing.
if($this->response->isFinished()) {
$this->popCurrent();
return $this->response;
}
$body = parent::handleRequest($request);
if($body instanceof HTTPResponse) {
if(isset($_REQUEST['debug_request'])) Debug::message("Request handler returned HTTPResponse object to $this->class controller; returning it without modification.");
$this->response = $body;
} else {
if(is_object($body)) {
if(isset($_REQUEST['debug_request'])) Debug::message("Request handler $body->class object to $this->class controller;, rendering with template returned by $body->class::getViewer()");
$body = $body->getViewer($request->latestParam('Action'))->process($body);
}
$this->response->setBody($body);
}
ContentNegotiator::process($this->response);
HTTP::add_cache_headers($this->response);
$this->popCurrent();
return $this->response;
}