Topics

Class Response

Controller response. Use to output from the controller.

Namespace: Ip

Methods:

__construct( [ mixed $content = null ] , [ mixed $headers = null ] , [ mixed $statusCode = 200 ] )
addHeader( mixed $value )

Add HTTP header

Parameters:

mixed $value
array getHeaders( )

Get HTTP headers

Return values:

array
Ip\Response setStatusCode( integer $code )

Set HTTP status code

Parameters:

integer $code Status code

Return values:

Ip\Response
integer getStatusCode( )

Retrieve HTTP status code

Return values:

integer HTTP status code
mixed setStatusMessage( string $message )

Set HTTP status message

Parameters:

string $message Status message text

Return values:

mixed $this
boolean isClientError( )

Check if HTTP status code is Client error

Return values:

boolean
boolean isForbidden( )

Check if HTTP status code is 403 Forbidden

Return values:

boolean
boolean isInformational( )

Check if a page returns HTTP informational status code

Return values:

boolean
boolean isNotFound( )

Check if HTTP status is 404 Page not found

Return values:

boolean
boolean isOk( )

Check if HTTP status is 200 Ok

Return values:

boolean
boolean isServerError( )

Check if HTTP status is Server error

Return values:

boolean
boolean isRedirect( )

Check if HTTP status is Redirect

Return values:

boolean
boolean isSuccess( )

Check if HTTP status is Success

Return values:

boolean
null setContent( String $content )

Set webpage content

Parameters:

String $content

Return values:

null
string getContent( )

Get webpage content

Return values:

string
string render( )

Returns rendered version of a content

Return values:

string
send( )

Sends a page to web browser

comments powered by Disqus