PHP Class Zend\Mvc\SendResponseListener

Inheritance: extends Zend\EventManager\AbstractListenerAggregate, implements Zend\EventManager\EventManagerAwareInterface
Mostra file Open project: zendframework/zend-mvc Class Usage Examples

Protected Properties

Property Type Description
$event Zend\Mvc\ResponseSender\SendResponseEvent
$eventManager Zend\EventManager\EventManagerInterface

Public Methods

Method Description
attach ( Zend\EventManager\EventManagerInterface $events, integer $priority = 1 ) : void Attach the aggregate to the specified event manager
getEvent ( ) : Zend\Mvc\ResponseSender\SendResponseEvent Get the send response event
getEventManager ( ) : Zend\EventManager\EventManagerInterface Retrieve the event manager
sendResponse ( MvcEvent $e ) : void Send the response
setEvent ( Zend\Mvc\ResponseSender\SendResponseEvent $e ) : Zend\Mvc\ResponseSender\SendResponseEvent Set the send response event
setEventManager ( Zend\EventManager\EventManagerInterface $eventManager ) : SendResponseListener Inject an EventManager instance

Protected Methods

Method Description
attachDefaultListeners ( ) : SendResponseListener Register the default event listeners

Method Details

attach() public method

Attach the aggregate to the specified event manager
public attach ( Zend\EventManager\EventManagerInterface $events, integer $priority = 1 ) : void
$events Zend\EventManager\EventManagerInterface
$priority integer
return void

attachDefaultListeners() protected method

The order in which the response sender are listed here, is by their usage: PhpEnvironmentResponseSender has highest priority, because it's used most often. SimpleStreamResponseSender is not used that often, so has a lower priority. You can attach your response sender before or after every default response sender implementation. All default response sender implementation have negative priority. You are able to attach listeners without giving a priority and your response sender would be first to try.
protected attachDefaultListeners ( ) : SendResponseListener
return SendResponseListener

getEvent() public method

Get the send response event
public getEvent ( ) : Zend\Mvc\ResponseSender\SendResponseEvent
return Zend\Mvc\ResponseSender\SendResponseEvent

getEventManager() public method

Lazy-loads an EventManager instance if none registered.
public getEventManager ( ) : Zend\EventManager\EventManagerInterface
return Zend\EventManager\EventManagerInterface

sendResponse() public method

Send the response
public sendResponse ( MvcEvent $e ) : void
$e MvcEvent
return void

setEvent() public method

Set the send response event
public setEvent ( Zend\Mvc\ResponseSender\SendResponseEvent $e ) : Zend\Mvc\ResponseSender\SendResponseEvent
$e Zend\Mvc\ResponseSender\SendResponseEvent
return Zend\Mvc\ResponseSender\SendResponseEvent

setEventManager() public method

Inject an EventManager instance
public setEventManager ( Zend\EventManager\EventManagerInterface $eventManager ) : SendResponseListener
$eventManager Zend\EventManager\EventManagerInterface
return SendResponseListener

Property Details

$event protected_oe property

protected SendResponseEvent,Zend\Mvc\ResponseSender $event
return Zend\Mvc\ResponseSender\SendResponseEvent

$eventManager protected_oe property

protected EventManagerInterface,Zend\EventManager $eventManager
return Zend\EventManager\EventManagerInterface