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


PHP ServerRequestInterface::withQueryParams方法代码示例

本文整理汇总了PHP中Psr\Http\Message\ServerRequestInterface::withQueryParams方法的典型用法代码示例。如果您正苦于以下问题:PHP ServerRequestInterface::withQueryParams方法的具体用法?PHP ServerRequestInterface::withQueryParams怎么用?PHP ServerRequestInterface::withQueryParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Psr\Http\Message\ServerRequestInterface的用法示例。


在下文中一共展示了ServerRequestInterface::withQueryParams方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: changingListenerVariableWillBeRespectedWhenDeterminingActionToken

 /**
  * @test
  */
 public function changingListenerVariableWillBeRespectedWhenDeterminingActionToken()
 {
     $this->request = $this->request->withQueryParams(['mylistener' => 'sample.action']);
     $this->router->setListener('mylistener');
     $this->request = $this->router->resolveActionToken($this->request);
     $this->assertSame('sample.action', $this->request->getAttribute(Router::ACTIONTOKEN_ATTR));
 }
开发者ID:geekishmatt,项目名称:adroit,代码行数:10,代码来源:PropertyRouterUnitTest.php

示例2: withQueryParams

 /**
  * @inheritDoc
  */
 public function withQueryParams(array $query)
 {
     $self = clone $this;
     $self->serverRequest = $this->serverRequest->withQueryParams($query);
     $self->initializeParsedQueryParams();
     return $self;
 }
开发者ID:superbull,项目名称:super,代码行数:10,代码来源:Request.php

示例3: routeParamsOverwriteQueryParams

 /**
  * @test
  */
 public function routeParamsOverwriteQueryParams()
 {
     $this->request = new ServerRequest([], [], '/user/123', 'GET');
     $this->request = $this->request->withQueryParams(['userId' => '999']);
     $this->request = $this->router->match($this->request);
     $targetRequestAttribute = $this->router->getTargetRequestAttribute();
     $queryParams = $this->request->getQueryParams();
     $this->assertTrue(isset($queryParams['userId']));
     $this->assertSame('123', $queryParams['userId']);
 }
开发者ID:geekishmatt,项目名称:pathfinder,代码行数:13,代码来源:Psr7RouterUnitTest.php

示例4: withQueryParams

 /**
  * {@inheritdoc}
  */
 public function withQueryParams(array $query)
 {
     return new static($this->wrapped->withQueryParams($query));
 }
开发者ID:Mosaic,项目名称:Mosaic,代码行数:7,代码来源:Request.php

示例5: parse

 /**
  * @inheritDoc
  */
 public function parse(ServerRequestInterface $request) : ServerRequestInterface
 {
     parse_str($request->getUri()->getQuery(), $queryParams);
     return $request->withQueryParams($queryParams);
 }
开发者ID:aurimasniekis,项目名称:http,代码行数:8,代码来源:QueryParamParser.php

示例6: withQueryParams

 /**
  * {@inheritDoc}
  */
 public function withQueryParams(array $query)
 {
     return new self($this->app, $this->psrRequest->withQueryParams($query));
 }
开发者ID:tonis-io,项目名称:tonis,代码行数:7,代码来源:Request.php

示例7: withQueryParams

 /**
  * Proxy to ServerRequestInterface::withQueryParams()
  *
  * {@inheritdoc}
  */
 public function withQueryParams(array $query)
 {
     $new = $this->psrRequest->withQueryParams($query);
     return new self($new, $this->originalRequest);
 }
开发者ID:michaelmoussa,项目名称:zend-stratigility,代码行数:10,代码来源:Request.php

示例8: applyRoutingResult

 /**
  * Offers possibility to manipulate the request according to routing result.
  * Returns a new {@link \Psr\Http\Message\ServerRequestInterface}.
  *
  * @param ServerRequestInterface $request
  * @param RoutingResult $routingResult
  * @return ServerRequestInterface
  */
 protected function applyRoutingResult(ServerRequestInterface $request, RoutingResult $routingResult) : ServerRequestInterface
 {
     $routingParams = $routingResult->getParams();
     $params = array_merge($request->getQueryParams(), $routingParams);
     return $request->withQueryParams($params);
 }
开发者ID:bitexpert,项目名称:pathfinder,代码行数:14,代码来源:BasicRoutingMiddleware.php


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