當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IRequest::getQuery方法代碼示例

本文整理匯總了PHP中Nette\Http\IRequest::getQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP IRequest::getQuery方法的具體用法?PHP IRequest::getQuery怎麽用?PHP IRequest::getQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nette\Http\IRequest的用法示例。


在下文中一共展示了IRequest::getQuery方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getQuery

 /**
  * @inheritdoc
  */
 public function getQuery($key = NULL, $default = NULL)
 {
     if (func_num_args() === 0) {
         return $this->current->getQuery();
     }
     return $this->current->getQuery($key, $default);
 }
開發者ID:Kdyby,項目名稱:RequestStack,代碼行數:10,代碼來源:RequestStack.php

示例2: parseData

 /**
  * Parse data for input
  * @return array
  *
  * @throws BadRequestException
  */
 protected function parseData()
 {
     $postQuery = (array) $this->httpRequest->getPost();
     $urlQuery = (array) $this->httpRequest->getQuery();
     $requestBody = $this->parseRequestBody();
     return array_merge($urlQuery, $requestBody, $postQuery);
 }
開發者ID:lucien144,項目名稱:Restful,代碼行數:13,代碼來源:InputFactory.php

示例3: send

 /**
  * Send JSONP response to output
  * @param IRequest $httpRequest
  * @param IResponse $httpResponse
  * @throws \Drahak\Restful\InvalidArgumentException
  */
 public function send(IRequest $httpRequest, IResponse $httpResponse)
 {
     $httpResponse->setContentType($this->contentType ? $this->contentType : 'application/javascript', 'UTF-8');
     $data = array();
     $data['response'] = $this->data;
     $data['status'] = $httpResponse->getCode();
     $data['headers'] = $httpResponse->getHeaders();
     $callback = $httpRequest->getQuery('jsonp') ? Strings::webalize($httpRequest->getQuery('jsonp'), NULL, FALSE) : '';
     echo $callback . '(' . $this->mapper->stringify($data, $this->isPrettyPrint()) . ');';
 }
開發者ID:lucien144,項目名稱:Restful,代碼行數:16,代碼來源:JsonpResponse.php

示例4: getParameters

 /**
  * Get all parameters
  * @return array
  */
 public function getParameters()
 {
     if (!$this->data) {
         if ($this->request->getQuery()) {
             $this->data = $this->request->getQuery();
         } else {
             if ($this->request->getPost()) {
                 $this->data = $this->request->getPost();
             } else {
                 $this->data = $this->parseRequest(file_get_contents('php://input'));
             }
         }
     }
     return $this->data;
 }
開發者ID:drahak,項目名稱:oauth2,代碼行數:19,代碼來源:Input.php

示例5: match

 /**
  * CLI commands run from app/console.php
  *
  * Maps HTTP request to a Request object.
  * @return Nette\Application\Request|NULL
  */
 public function match(Nette\Http\IRequest $httpRequest)
 {
     $this->loadLocales();
     $urlPath = new Services\UrlPath($httpRequest);
     $urlPath->setPredefinedLocales($this->locales);
     /** @var Url $urlEntity */
     $urlEntity = $this->loadUrlEntity($urlPath->getPath(true));
     if ($urlEntity === null) {
         // no route found
         $this->onUrlNotFound($urlPath);
         return null;
     }
     if ($urlEntity->getActualUrlToRedirect() === null) {
         $presenter = $urlEntity->getPresenter();
         $internal_id = $urlEntity->getInternalId();
         $action = $urlEntity->getAction();
     } else {
         $presenter = $urlEntity->getActualUrlToRedirect()->getPresenter();
         $internal_id = $urlEntity->getActualUrlToRedirect()->getInternalId();
         $action = $urlEntity->getActualUrlToRedirect()->getAction();
     }
     $params = $httpRequest->getQuery();
     $params['action'] = $action;
     $params['locale'] = $urlPath->getLocale();
     $this->urlParametersConverter->in($urlEntity, $params);
     // todo
     if ($internal_id !== null) {
         $params['internal_id'] = $internal_id;
     }
     return new Nette\Application\Request($presenter, $httpRequest->getMethod(), $params, $httpRequest->getPost(), $httpRequest->getFiles());
 }
開發者ID:blitzik,項目名稱:CMS,代碼行數:37,代碼來源:Router.php

示例6: match

	/**
	 * Maps HTTP request to a Request object.
	 * @return Nette\Application\Request|NULL
	 */
	public function match(Nette\Http\IRequest $httpRequest)
	{
		if ($httpRequest->getUrl()->getPathInfo() !== '') {
			return NULL;
		}
		// combine with precedence: get, (post,) defaults
		$params = $httpRequest->getQuery();
		$params += $this->defaults;

		if (!isset($params[self::PRESENTER_KEY]) || !is_string($params[self::PRESENTER_KEY])) {
			return NULL;
		}

		$presenter = $this->module . $params[self::PRESENTER_KEY];
		unset($params[self::PRESENTER_KEY]);

		return new Application\Request(
			$presenter,
			$httpRequest->getMethod(),
			$params,
			$httpRequest->getPost(),
			$httpRequest->getFiles(),
			array(Application\Request::SECURED => $httpRequest->isSecured())
		);
	}
開發者ID:nakoukal,項目名稱:fakturace,代碼行數:29,代碼來源:SimpleRouter.php

示例7: match

 /**
  * Maps HTTP request to a Request object.
  *
  * @param Nette\Http\IRequest $httpRequest
  * @return Request|NULL
  */
 public function match(Nette\Http\IRequest $httpRequest)
 {
     $relativeUrl = trim($httpRequest->getUrl()->relativeUrl, "/");
     $path = trim($httpRequest->getUrl()->path, "/");
     if ($relativeUrl == "") {
         $target = $this->defaultRoute;
         $this->currentTarget->setCurrentTarget($this->targetDao->findTarget($target->presenter, $target->action, $target->id));
     } elseif ($relativeUrl == "sitemap.xml") {
         $target = new Target("Seo:Meta", "sitemap");
     } elseif ($relativeUrl == "robots.txt") {
         $target = new Target("Seo:Meta", "robots");
     } elseif (substr($relativeUrl, 0, 6) == "google" && $this->settingsDao->getWebmasterToolsName() == $relativeUrl) {
         $target = new Target("Seo:Meta", "googleWebmasterTools");
     } else {
         $route = $this->routeDao->findRouteBySlug($relativeUrl, TRUE);
         if (!$route) {
             $route = $this->routeDao->findRouteBySlug($path, TRUE);
             if (!$route) {
                 return NULL;
             }
         }
         $this->currentTarget->setCurrentTarget($route->getTarget());
         $target = new Target($route->target->targetPresenter, $route->target->targetAction, $route->target->targetId);
     }
     $params = array();
     $params["action"] = $target->action;
     if ($target->id) {
         $params["id"] = $target->id;
     }
     $params += $httpRequest->getQuery();
     return new Request($target->presenter, $httpRequest->getMethod(), $params, $httpRequest->getPost(), $httpRequest->getFiles(), array(Request::SECURED => $httpRequest->isSecured()));
 }
開發者ID:brabijan,項目名稱:nette-seo-components,代碼行數:38,代碼來源:DbRouter.php

示例8: parse

 /**
  * @param Http\Request $request
  * @return array
  */
 private function parse(Http\IRequest $request)
 {
     $params = array_merge($request->getPost(), $request->getQuery());
     if ($this->parser !== null) {
         $parsed = $this->parser->parse($request->getRawBody());
         $params = array_merge($params, $parsed);
     }
     return $params;
 }
開發者ID:dzibma,項目名稱:rest-api,代碼行數:13,代碼來源:Input.php

示例9: getRequest

 /**
  * @param string $key
  * @param mixed $default
  * @return mixed|null
  */
 protected function getRequest($key, $default = NULL)
 {
     if ($value = $this->httpRequest->getPost($key)) {
         return $value;
     }
     if ($value = $this->httpRequest->getQuery($key)) {
         return $value;
     }
     return $default;
 }
開發者ID:kdyby,項目名稱:facebook,代碼行數:15,代碼來源:Facebook.php

示例10: match

 /**
  * Maps HTTP request to a Request object.
  * @return array|NULL
  */
 public function match(Nette\Http\IRequest $request)
 {
     if ($request->getUrl()->getPathInfo() !== '') {
         return NULL;
     }
     // combine with precedence: get, (post,) defaults
     $params = $request->getQuery();
     $params += $this->defaults;
     return $params;
 }
開發者ID:nette,項目名稱:routing,代碼行數:14,代碼來源:SimpleRouter.php

示例11: send

 /**
  * @param Nette\Http\IRequest $httpRequest
  * @param Nette\Http\IResponse $httpResponse
  * @throws \Nette\Application\BadRequestException
  */
 public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse)
 {
     $httpResponse->setContentType($this->contentType);
     $httpResponse->setExpiration(FALSE);
     $callback = $httpRequest->getQuery(self::$callbackName);
     if (is_null($callback)) {
         throw new \Nette\Application\BadRequestException("Invalid JSONP request.");
     }
     echo $callback . "(" . Nette\Utils\Json::encode($this->payload) . ")";
 }
開發者ID:frosty22,項目名稱:ale,代碼行數:15,代碼來源:JsonpResponse.php

示例12: isPrettyPrint

 /**
  * Is pretty print enabled
  * @param  IRequest $request 
  * @return boolean           
  */
 protected function isPrettyPrint()
 {
     $prettyPrintKey = $this->request->getQuery($this->prettyPrintKey);
     if ($prettyPrintKey === 'false') {
         return FALSE;
     }
     if ($prettyPrintKey === 'true') {
         return TRUE;
     }
     return $this->prettyPrint;
 }
開發者ID:marten-cz,項目名稱:Restful,代碼行數:16,代碼來源:ResponseFactory.php

示例13: createPaginator

 /**
  * Create paginator
  * @param int|null $offset
  * @param int|null $limit
  * @return Paginator
  *
  * @throws InvalidStateException
  */
 protected function createPaginator($offset = NULL, $limit = NULL)
 {
     $offset = $this->request->getQuery('offset', $offset);
     $limit = $this->request->getQuery('limit', $limit);
     if ($offset === NULL || $limit === NULL) {
         throw new InvalidStateException('To create paginator add offset and limit query parameter to request URL');
     }
     $paginator = new Paginator();
     $paginator->setItemsPerPage($limit);
     $paginator->setPage(floor($offset / $limit) + 1);
     return $paginator;
 }
開發者ID:surda,項目名稱:Restful,代碼行數:20,代碼來源:RequestFilter.php

示例14: getPreferredMethod

 /**
  * Get prederred method 
  * @param  IRequest $request 
  * @return string            
  */
 protected function getPreferredMethod(IRequest $request)
 {
     $method = $request->getMethod();
     $isPost = $method === IRequest::POST;
     $header = $request->getHeader(self::OVERRIDE_HEADER);
     $param = $request->getQuery(self::OVERRIDE_PARAM);
     if ($header && $isPost) {
         return $header;
     }
     if ($param && $isPost) {
         return $param;
     }
     return $request->getMethod();
 }
開發者ID:lucien144,項目名稱:Restful,代碼行數:19,代碼來源:ApiRequestFactory.php

示例15: handleResponse

 /**
  * Signal for receive a response from gateway.
  */
 public function handleResponse()
 {
     $data = $this->httpRequest->isMethod(IRequest::POST) ? $this->httpRequest->getPost() : $this->httpRequest->getQuery();
     $response = NULL;
     try {
         $response = $this->client->receiveResponse($data);
     } catch (Csob\Exception $e) {
         if ($response === NULL && $e instanceof Csob\ExceptionWithResponse) {
             $response = $e->getResponse();
         }
         $this->onError($this, $e, $response);
         return;
     }
     $this->onResponse($this, $response);
 }
開發者ID:jiripudil,項目名稱:CsobPaygateNette,代碼行數:18,代碼來源:CsobControl.php


注:本文中的Nette\Http\IRequest::getQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。