当前位置: 首页>>代码示例>>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;未经允许,请勿转载。