The SendResponse Event
laminas-mvc defines and utilizes a custom
Laminas\EventManager\Event for updating
the response object prior to emitting it,
The event allows listeners to set response headers and content.
The methods it defines are:
Currently, three listeners are listening to this event at different priorities based on which listener is used most.
||This is used in HTTP contexts (this is the most often used).|
||This is used in console contexts.|
Because each listener has negative priority, adding your own logic to modify the
Response involves adding a new listener without priority (as priority defaults
to 1); thus, your own listener will execute before any of the defaults.
This event is executed when the
MvcEvent::FINISH event is triggered, with a priority of -10000.