zendframework/zf2 — pull request #2195 by Ocramius (2012-08-17 19:25:07+00:00)
Title: [2.1] [WIP] Event driven view layer

tl;dr: Feel free to add suggestions, I will ping for review (close and re-open if dirty) once this is ready

This PR will introduce

1. event driven view rendering: It should now be possible to attach event listeners to the event manager in `Zend\View\View`, thus allowing to prepend and append content to the output generated when rendering a view model by listening to `Zend\View\ViewEvent::EVENT_RENDER` **(already working)**
2. Testing **(TBD)**
3. Move the default render listener to its own class (probably a `Zend\EventManager\ListenerAggregateInterface`) **(TBD)**
4. Attach the default listener via `Zend\Mvc\Service\*` (factories, etc) **(TBD)**
5. Provide accessory methods to set the current produced output in the `Zend\View\ViewEvent` **(Unsure)**
6. Avoid registering the `Zend\View\ViewEvent` within the `Zend\View\View` object itself (problematic when having multiple concurring events being triggered). **(Unsure)**