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


PHP Response::getStatusCode方法代碼示例

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


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

示例1: setReactResponse

 /**
  * It performs the setup of a reactPHP response from a SlimpPHP response
  * object and finishes the communication
  *
  * @param \React\Http\Response $reactResp    ReactPHP native response object
  * @param \Slim\Http\Response  $slimResponse SlimPHP native response object
  * @param boolean              $endRequest   If true, response flush will be finished
  *
  * @return void
  */
 static function setReactResponse(\React\Http\Response $reactResp, \Slim\Http\Response $slimResponse, $endRequest = false)
 {
     $headers = static::reduceHeaders($slimResponse->getHeaders());
     $reactResp->writeHead($slimResponse->getStatusCode(), $headers);
     $reactResp->write($slimResponse->getBody());
     if ($endRequest === true) {
         $reactResp->end();
     }
 }
開發者ID:mbarquin,項目名稱:reactphp-slim,代碼行數:19,代碼來源:SlimResponse.php

示例2: testWithRedirect

 /**
  * @covers Slim\Http\Response::withRedirect
  */
 public function testWithRedirect()
 {
     $response = new Response(200);
     $clone = $response->withRedirect('/foo', 301);
     $this->assertSame(200, $response->getStatusCode());
     $this->assertFalse($response->hasHeader('Location'));
     $this->assertSame(301, $clone->getStatusCode());
     $this->assertTrue($clone->hasHeader('Location'));
     $this->assertEquals('/foo', $clone->getHeaderLine('Location'));
 }
開發者ID:hidayat365,項目名稱:phpindonesia.or.id-membership2,代碼行數:13,代碼來源:ResponseTest.php

示例3: assertThatResponseHasStatus

 protected function assertThatResponseHasStatus($expectedStatus)
 {
     $this->assertEquals($expectedStatus, $this->response->getStatusCode());
 }
開發者ID:ClearcodeHQ,項目名稱:eh-library-sandbox-slim,代碼行數:4,代碼來源:WebTestCase.php

示例4: getStatusCode

 /**
  * Returns response status code
  *
  * @return int
  */
 public function getStatusCode()
 {
     return $this->response->getStatusCode();
 }
開發者ID:krlv,項目名稱:service-skeleton,代碼行數:9,代碼來源:WebTestClient.php


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