<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Class Phalcon\\Http\\Response # Class **Phalcon\\Http\\Response** *implements*[*Phalcon\\Http\\ResponseInterface*](#), `Phalcon\Di\InjectionAwareInterface` Part of the HTTP cycle is return responses to the clients. Phalcon\\HTTP\\Response is the Phalcon component responsible to achieve this task. HTTP responses are usually composed by headers and body. ``` <pre class="calibre14">``` <?php $response = new \Phalcon\Http\Response(); $response->setStatusCode(200, "OK"); $response->setContent("<html><body>Hello</body></html>"); $response->send(); ``` ``` ### Methods public **\_\_construct** (\[*string* $content\], \[*int* $code\], \[*string* $status\]) Phalcon\\Http\\Response constructor public **setDI** (*unknown* $dependencyInjector) Sets the dependency injector public **getDI** () Returns the internal dependency injector public **setStatusCode** (*unknown* $code, \[*unknown* $message\]) Sets the HTTP response code ``` <pre class="calibre14">``` <?php $response->setStatusCode(404, "Not Found"); ``` ``` public **getStatusCode** () Returns the status code ``` <pre class="calibre14">``` <?php print_r($response->getStatusCode()); ``` ``` public **setHeaders** (*unknown* $headers) Sets a headers bag for the response externally public **getHeaders** () Returns headers set by the user public **setCookies** (*unknown* $cookies) Sets a cookies bag for the response externally public [*Phalcon\\Http\\Response\\CookiesInterface*](#)**getCookies** () Returns coookies set by the user public <a class="calibre6 pcalibre1" href="">*Phalcon\\Http\\Response*</a>**setHeader** (*string* $name, *string* $value) Overwrites a header in the response ``` <pre class="calibre14">``` <?php $response->setHeader("Content-Type", "text/plain"); ``` ``` public **setRawHeader** (*unknown* $header) Send a raw header to the response ``` <pre class="calibre14">``` <?php $response->setRawHeader("HTTP/1.1 404 Not Found"); ``` ``` public **resetHeaders** () Resets all the stablished headers public **setExpires** (*unknown* $datetime) Sets a Expires header to use HTTP cache ``` <pre class="calibre14">``` <?php $this->response->setExpires(new DateTime()); ``` ``` public **setNotModified** () Sends a Not-Modified response public <a class="calibre6 pcalibre1" href="">*Phalcon\\Http\\Response*</a>**setContentType** (*string* $contentType, \[*string* $charset\]) Sets the response content-type mime, optionally the charset ``` <pre class="calibre14">``` <?php $response->setContentType('application/pdf'); $response->setContentType('text/plain', 'UTF-8'); ``` ``` public **setEtag** (*unknown* $etag) Set a custom ETag ``` <pre class="calibre14">``` <?php $response->setEtag(md5(time())); ``` ``` public <a class="calibre6 pcalibre1" href="">*Phalcon\\Http\\Response*</a>**redirect** (\[*string|array* $location\], \[*boolean* $externalRedirect\], \[*int* $statusCode\]) Redirect by HTTP to another action or URL ``` <pre class="calibre14">``` <?php //Using a string redirect (internal/external) $response->redirect("posts/index"); $response->redirect("http://en.wikipedia.org", true); $response->redirect("http://www.example.com/new-location", true, 301); //Making a redirection based on a named route $response->redirect(array( "for" => "index-lang", "lang" => "jp", "controller" => "index" )); ``` ``` public **setContent** (*unknown* $content) Sets HTTP response body ``` <pre class="calibre14">``` <?php response->setContent("<h1>Hello!</h1>"); ``` ``` public <a class="calibre6 pcalibre1" href="">*Phalcon\\Http\\Response*</a>**setJsonContent** (*mixed* $content, \[*int* $jsonOptions\], \[*unknown* $depth\]) Sets HTTP response body. The parameter is automatically converted to JSON ``` <pre class="calibre14">``` <?php $response->setJsonContent(array("status" => "OK")); ``` ``` public <a class="calibre6 pcalibre1" href="">*Phalcon\\Http\\Response*</a>**appendContent** (*string* $content) Appends a string to the HTTP response body public **getContent** () Gets the HTTP response body public **isSent** () Check if the response is already sent public **sendHeaders** () Sends headers to the client public **sendCookies** () Sends cookies to the client public **send** () Prints out HTTP response to the client public <a class="calibre6 pcalibre1" href="">*Phalcon\\Http\\Response*</a>**setFileToSend** (*string* $filePath, \[*string* $attachmentName\], \[*unknown* $attachment\]) Sets an attached file to be sent at the end of the request | - [索引](# "總目錄") - [下一頁](# "Class Phalcon\Http\Response\Cookies") | - [上一頁](# "Class Phalcon\Http\Request\File") | - [API Indice](#) ?
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看