HTTP_Encoder::sendAll PHP Method

sendAll() public method

A shortcut for sendHeaders() and echo getContent() You must call this before headers are sent and it probably cannot be used in conjunction with zlib output buffering / mod_gzip. Errors are not handled purposefully.
public sendAll ( )
    public function sendAll()
    {
        $this->sendHeaders();
        echo $this->_content;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Gzip (encode) the HTTP response and write to output.
  * @param string $strBody        The content that should be in the response.
  * @param string $strContentType The MIME type of the content.
  */
 public static function send($strBody, $strContentType = "text/html")
 {
     $objEncoder = new \HTTP_Encoder(array("content" => $strBody, "type" => $strContentType));
     $objEncoder->encode();
     $objEncoder->sendAll();
     exit;
 }
All Usage Examples Of HTTP_Encoder::sendAll