一些從控制器傳送標頭的範例...
/* 設定 Content-Type */
$response = $this -> getResponse();
$response -> setHeader( 'Content-Type', 'text/html; charset=utf-8' );
$response -> response();
/* 設定 HTTP 狀態 */
$response = $this -> getResponse();
$response -> setHeader( $this -> getRequest() -> getServer( 'SERVER_PROTOCOL' ), '404 Not Found' );
$response -> response();
您也可以使用 $_SERVER[ 'SERVER_PROTOCOL' ],但是建議擴充請求類別,對超級全域變數進行一些清理,這樣您就可以正常使用了。