Ergo\Http\ResponseSender::send PHP Method

send() public method

Sends the headers and body.
public send ( )
    public function send()
    {
        $response = $this->_response;
        header($response->getStatus()->__toString());
        foreach ($response->getHeaders() as $headerField) {
            header($headerField);
        }
        if ($response->hasBody()) {
            echo $response->getBody();
        }
    }

Usage Example

コード例 #1
0
ファイル: WebErrorHandler.php プロジェクト: 99designs/ergo
 public function handle($e)
 {
     $this->logException($e);
     if ($this->isExceptionHalting($e)) {
         // if headers are sent, we can't send a response
         if (headers_sent()) {
             echo $this->buildResponseBody($e);
             exit(0);
         }
         // send it off
         $sender = new Http\ResponseSender($this->buildResponse($e));
         $sender->send();
         if (ob_get_level() > 0) {
             ob_flush();
         }
         exit(self::EXIT_CODE);
     }
 }
All Usage Examples Of Ergo\Http\ResponseSender::send
ResponseSender