Class ResponseHandlerComponent
Response handler component
Handle json/xml response preparing data to serialize and setting up the right View class to use. Help to set headers for the client too.
- Object
- ResponseHandlerComponent
Methods summary
public
|
#
initialize( Controller $controller, array $settings = array() )
Initialize self::type from $settings or from extension or from request ACCEPT header |
public
|
|
public
|
#
beforeRender( Controller $controller )
The beforeRender Component callback If self::type was set and is supported (self::typesHandled) set content type header, the right View to use and data for view. |
public
string|null
|
|
public
|
|
public
|
|
public
|
|
private
|
Properties summary
public
array
|
$components
Other Components used |
#
array('RequestHandler')
|
public
Controller
|
$controller
The Controller |
#
null
|
public
boolean
|
$enabled
Determines whether or not callbacks will be fired on this component i.e. self::initialize(), self::startup(), self::beforeRender() |
#
true
|
protected
string|null
|
$type
The response type as 'json', 'xml' |
#
null
|
private
array
|
$typesHandled
The types that are automatically handled. For these types the right content type and the right View class are set. Moreover all view variables found in '_serialize' key will be prepared to be serialized in the right View |
#
array('json', 'xml')
|
public
string
|
$xmlFormat
Xml format (tags or attributes) |
#
'tags'
|