Class Response
Response This class should represent the HTTP response, done by the application.
Direct known subclasses
Modulework\Modules\Http\JsonResponse
,
Modulework\Modules\Http\RedirectResponse
Methods summary
public static
|
#
make( string $content = '', integer $code = 200, array $headers = array(),
Factory for the Response object |
public static
|
#
fromException(
Factory for the Response object Create a Response from a HttpException |
public
|
#
__construct( string $content = '', integer $code = 200, array $headers = array(),
Constructor. |
public
string
|
#
__toString( )
PHP' s magic method __toString Format: HTTP/{VERSION} {STATUSCODE} {STATUSTEXT} {HEADERS} {BODY} |
public
|
#
setHeaderWrapper(
Dependency injection for the HeaderWrapper (also availbe thru the constructor) If null is passed it will create a new instance of \Modulework\Modules\Http\Utilities\HeaderWrapper |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
prepare(
Prepares the response based on the Request object This method is not essential and can be cut out of the chain. However it cleans up the headers and does some other stuff under the hood. |
public
|
|
public
|
|
public
|
#
setStatusCode( integer $code = 200, string $txt = null )
Set the status code of the response If the text is null it will try to determine the text from the internal lib |
public
integer
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
#
setExpires(
Set the Expires HTTP header. To remove it pass NULL as parameter |
public
|
|
public
|
|
public
string
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
protected static
boolean
|
#
validateContent( mixed $content )
Validate the content Allowed types:
|
Magic methods summary
Properties summary
protected
string
|
$content |
#
The main content |
protected
integer
|
$statusCode |
#
The HTTP status code |
protected
string
|
$statusText |
#
The HTTP status Text |
protected
string
|
$charset |
#
The charset (header) |
protected
string
|
$protocolVersion |
#
The HTTP protocol version |
public static
array
|
$statusCodeRegistry |
#
The status code registry List according to http://www.iana.org/assignments/http-status-codes/http-status-codes.txt |
public
|
$headers |
#
The headers to get sent |
public
|
$cookies |
#
The cookies to get sent |
protected
|
$headerWrapper |
#
The HeaderWrapper |