当前位置: 首页>>代码示例>>PHP>>正文


PHP HTTPRequest::allParams方法代码示例

本文整理汇总了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']));
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:10,代码来源:ReportAdmin.php

示例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;
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:48,代码来源:Controller.php


注:本文中的HTTPRequest::allParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。