Example #1
0
 public function respond()
 {
     if (!headers_sent()) {
         // Status
         header(sprintf('HTTP/%s %s %s', $this->response->getProtocolVersion(), $this->response->getStatusCode(), $this->response->getReasonPhrase()));
         // Headers
         foreach ($this->response->getHeaders() as $name => $value) {
             header(sprintf('%s: %s', $name, $value), false);
         }
     }
     $body = $this->response->getBody();
     if ($body) {
         echo $body;
     }
     return $this;
 }