PHP Class Ergo\Http\ResponseBuilder

Afficher le fichier Open project: 99designs/ergo Class Usage Examples

Méthodes publiques

Méthode Description
addHeader ( string $name, string $value )
build ( ) : Response
cacheControl ( ) Sets the Cache-Control header to the strings passed as parameters.
created ( string $location ) Configures response as a '201 Created'.
expires ( $time ) Sets the Expires header based on a Unix timestamp.
forbidden ( ) Configures response as a '403 Forbidden'
found ( string $location ) Configures response as a '302 Found' temporary redirect.
methodNotAllowed ( ) Configures response as a '405 Method Not Allowed'
moved ( string $location ) Configures response as a '301 Moved Permanently' permanent redirect.
notCachable ( ) Sets the headers required to prevent response caching.
notFound ( ) Configures response as a '404 Not Found'
notModified ( ) Configures response as a '304 Not Modified'
setBody ( string $body ) Sets the body of the response.
setStatusCode ( integer $code )
view ( Ergo\View $view ) Uses a view to populate the body of the response

Method Details

addHeader() public méthode

public addHeader ( string $name, string $value )
$name string
$value string

build() public méthode

public build ( ) : Response
Résultat Response

cacheControl() public méthode

Sets the Cache-Control header to the strings passed as parameters.
public cacheControl ( )

created() public méthode

Configures response as a '201 Created'.
public created ( string $location )
$location string

expires() public méthode

Sets the Expires header based on a Unix timestamp.
public expires ( $time )

forbidden() public méthode

Configures response as a '403 Forbidden'
public forbidden ( )

found() public méthode

Configures response as a '302 Found' temporary redirect.
public found ( string $location )
$location string

methodNotAllowed() public méthode

Configures response as a '405 Method Not Allowed'
public methodNotAllowed ( )

moved() public méthode

Configures response as a '301 Moved Permanently' permanent redirect.
public moved ( string $location )
$location string

notCachable() public méthode

Sets the headers required to prevent response caching.
public notCachable ( )

notFound() public méthode

Configures response as a '404 Not Found'
public notFound ( )

notModified() public méthode

Configures response as a '304 Not Modified'
public notModified ( )

setBody() public méthode

Sets the body of the response.
public setBody ( string $body )
$body string

setStatusCode() public méthode

public setStatusCode ( integer $code )
$code integer

view() public méthode

Uses a view to populate the body of the response
public view ( Ergo\View $view )
$view Ergo\View