Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
JsonStrategy Class Reference

Public Member Functions

 __construct (JsonRenderer $renderer)
 Constructor.
 
 attach (EventManagerInterface $events, $priority=1)
 Attach one or more listeners.Implementors may add an optional $priority argument; the EventManager implementation will pass this to the aggregate.
Parameters
EventManagerInterface$events
int$priority
Returns
void

 
 setCharset ($charset)
 Set the content-type character set.
 
 getCharset ()
 Retrieve the current character set.
 
 selectRenderer (ViewEvent $e)
 Detect if we should use the JsonRenderer based on model type and/or Accept header.
 
 injectResponse (ViewEvent $e)
 Inject the response with the JSON payload and appropriate Content-Type header.
 
- Public Member Functions inherited from AbstractListenerAggregate
 detach (EventManagerInterface $events)
 Detach all previously attached listeners.
Parameters
EventManagerInterface$events
Returns
void

 

Protected Attributes

 $charset = 'utf-8'
 
 $multibyteCharsets
 
 $renderer
 
- Protected Attributes inherited from AbstractListenerAggregate
 $listeners = []
 

Constructor & Destructor Documentation

__construct ( JsonRenderer  $renderer)

Constructor.

Parameters
JsonRenderer$renderer

Member Function Documentation

attach ( EventManagerInterface  $events,
  $priority = 1 
)

Attach one or more listeners.Implementors may add an optional $priority argument; the EventManager implementation will pass this to the aggregate.

Parameters
EventManagerInterface$events
int$priority
Returns
void

Implements ListenerAggregateInterface.

getCharset ( )

Retrieve the current character set.

Returns
string
injectResponse ( ViewEvent  $e)

Inject the response with the JSON payload and appropriate Content-Type header.

Parameters
ViewEvent$e
Returns
void
selectRenderer ( ViewEvent  $e)

Detect if we should use the JsonRenderer based on model type and/or Accept header.

Parameters
ViewEvent$e
Returns
null|JsonRenderer
setCharset (   $charset)

Set the content-type character set.

Parameters
string$charset
Returns
JsonStrategy

Member Data Documentation

$charset = 'utf-8'
protected
$multibyteCharsets
protected
Initial value:
= [
'UTF-16',
'UTF-32',
]
$renderer
protected