$header
$header :array
List of additional header fields
__construct(boolean $status = false,string $message = "",mixed $values = array(),mixed $secondary = array())
Construct response construct a new instance of the response object
boolean | $status | The boolean state of the initialised status |
string | $message | The first message |
mixed | $values | The first values |
mixed | $secondary | The secondary values |
Redirect(string|array $path,boolean $direct = false)
Set redirect
Redirect to this path. The url will be interpreted as internal link by default. To use external targets, set the second argument to true
string|array | $path | The absolute redirect path or an array with path and query arguments |
boolean | $direct | Set as direct response type |
Type(integer $type = null,string $value = null): integer|null
Expose type getter / setter
Provide an interface to the local response content type
The type is one of: FAA_RESPONSE_TYPE_JSON, FAA_RESPONSE_TYPE_HTML, FAA_RESPONSE_TYPE_ATTACHMENT, FAA_RESPONSE_TYPE_CORS, FAA_RESPONSE_TYPE_DIRECT_REDIRECT, FAA_RESPONSE_TYPE_XML, FAA_RESPONSE_TYPE_TXT, FAA_RESPONSE_TYPE_CUSTOM, FAA_RESPONSE_TYPE_ATTACHMENT_AUTO
integer | $type | The system response type |
string | $value | The system response content type as string |
The system response type or void in setter mode
SetSuccess(integer $code = 201,string $path = null)
Set http success code
Can be used to set a paths for the next call as well Set the status of the instance to true
integer | $code | The response code, should be of 200 - 299 |
string | $path | Can be set to a redirect path e.g. after POST witch created result |
SetAttachment(string $path,string $name,integer $mode = FAA_RESPONSE_TYPE_ATTACHMENT): boolean
Send as file attachment
Set outbound parse mode to attachment. Query parameters and anchor parts will be stripped automatically
string | $path | The absolute file path |
string | $name | The file name |
integer | $mode | The file mime type handling option, either FAA_RESPONSE_TYPE_ATTACHMENT or, FAA_RESPONSE_TYPE_ATTACHMENT_AUTO |