PHP Класс Ergo\Http\ResponseBuilder

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

addHeader() публичный Метод

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

build() публичный Метод

public build ( ) : Response
Результат Response

cacheControl() публичный Метод

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

created() публичный Метод

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

expires() публичный Метод

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

forbidden() публичный Метод

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

found() публичный Метод

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

methodNotAllowed() публичный Метод

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

moved() публичный Метод

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

notCachable() публичный Метод

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

notFound() публичный Метод

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

notModified() публичный Метод

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

setBody() публичный Метод

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

setStatusCode() публичный Метод

public setStatusCode ( integer $code )
$code integer

view() публичный Метод

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