Can someone point me in the proper direction for creating a zend-mvc style postDispatch plugin?
I tried using afterDispatchLoop() but I need a way to access the current response. The goal is to do some sort of filter on the Response (rendered layout + view) , and then reset the response with the new filtered text.
I also tried using afterRender() and beforeRender() but had no luck because the response that I get from the dependency injector is empty.
Please help if you know how to achieve this! Thank you!
UPDATE
I have got it working using the View event (afterRender). This event passes an instance of the Phalcon MVC view, where you can subsequently modify the body of the entire view but calling $view->getContent() + manipulation, followed by $view->setContent().
I am used to working with HTTP Response objects like in Zend. Is there a better way to achieve this sort of response manipulation in Phalcon?