PHP Interface ManaPHP\Http\ResponseInterface

Afficher le fichier Open project: manaphp/manaphp

Méthodes publiques

Méthode Description
appendContent ( string $content ) : static Appends a string to the HTTP response body
getContent ( ) : string Gets the HTTP response body
redirect ( string | array $location, boolean $temporarily = true ) : static Redirect by HTTP to another action or URL
send ( ) : static Prints out HTTP response to the client
sendHeaders ( ) : static Sends headers to the client
setAttachment ( string $attachmentName ) : static
setContent ( string $content ) : static Sets HTTP response body
setContentType ( string $contentType, string $charset = null ) : static Sets the response content-type mime, optionally the charset
setCsvContent ( array $rows, string $attachmentName, array | string $columns = null ) : static
setExpires ( integer $timestamp ) : static Sets output expire time header
setFileToSend ( string $file, string $attachmentName = null ) : static Sets an attached file to be sent at the end of the request
setHeader ( string $name, string $value ) : static send a header in the response
setJsonContent ( array $content, integer $jsonOptions = null ) : static Sets HTTP response body. The parameter is automatically converted to JSON $response->setJsonContent(array("status" => "OK"));
setNotModified ( ) : static Sends a Not-Modified response
setRawHeader ( string $header ) : static Send a raw header in the response
setStatusCode ( integer $code, string $message ) : static Sets the HTTP response code

Method Details

appendContent() public méthode

Appends a string to the HTTP response body
public appendContent ( string $content ) : static
$content string
Résultat static

getContent() public méthode

Gets the HTTP response body
public getContent ( ) : string
Résultat string

redirect() public méthode

Redirect by HTTP to another action or URL
public redirect ( string | array $location, boolean $temporarily = true ) : static
$location string | array
$temporarily boolean
Résultat static

send() public méthode

Prints out HTTP response to the client
public send ( ) : static
Résultat static

sendHeaders() public méthode

Sends headers to the client
public sendHeaders ( ) : static
Résultat static

setAttachment() public méthode

public setAttachment ( string $attachmentName ) : static
$attachmentName string
Résultat static

setContent() public méthode

Sets HTTP response body
public setContent ( string $content ) : static
$content string
Résultat static

setContentType() public méthode

Sets the response content-type mime, optionally the charset
public setContentType ( string $contentType, string $charset = null ) : static
$contentType string
$charset string
Résultat static

setCsvContent() public méthode

public setCsvContent ( array $rows, string $attachmentName, array | string $columns = null ) : static
$rows array
$attachmentName string
$columns array | string
Résultat static

setExpires() public méthode

Sets output expire time header
public setExpires ( integer $timestamp ) : static
$timestamp integer
Résultat static

setFileToSend() public méthode

Sets an attached file to be sent at the end of the request
public setFileToSend ( string $file, string $attachmentName = null ) : static
$file string
$attachmentName string
Résultat static

setHeader() public méthode

send a header in the response
public setHeader ( string $name, string $value ) : static
$name string
$value string
Résultat static

setJsonContent() public méthode

Sets HTTP response body. The parameter is automatically converted to JSON $response->setJsonContent(array("status" => "OK"));
public setJsonContent ( array $content, integer $jsonOptions = null ) : static
$content array
$jsonOptions integer
Résultat static

setNotModified() public méthode

Sends a Not-Modified response
public setNotModified ( ) : static
Résultat static

setRawHeader() public méthode

Send a raw header in the response
public setRawHeader ( string $header ) : static
$header string
Résultat static

setStatusCode() public méthode

Sets the HTTP response code
public setStatusCode ( integer $code, string $message ) : static
$code integer
$message string
Résultat static