Zend Framework: how can I connect to the final presentation of the output before sending it to the browser?

I am trying to access the final xhtml output right before sending it to the browser as a string. The postDispatch () action methods and plugins seem to be too early for this. When I go through a method Zend_Controller_Front::dispatch()using the debugger, I can access the desired result as a string just before it is $this->_response->sendResponse()called at the very end by adding a watch expression $this->getResponse()->getBody(). However, there seems to be no special hook to use there. I need the final response element as a string to send it to Prince XML to create a pdf file. Does anyone know an elegant way to do this?

Thanks Adrian

+3
source share
2 answers

Plugin plugins are Zend_Controller_Frontas follows (from here ):

  • routeStartup()It is called before it Zend_Controller_Frontcalls the router to evaluate the request for registered routes.
  • routeShutdown() called after the router completes the routing of the request.
  • dispatchLoopStartup()called before it Zend_Controller_Frontenters the send cycle.
  • preDispatch()called before the dispatcher sends the action. This callback allows proxy or filter behavior. By changing the request and discarding its sent flag (through Zend_Controller_Request_Abstract::setDispatched(false)), the current action can be skipped and / or replaced.
  • postDispatch() , . . ( Zend_Controller_Request_Abstract::setDispatched(false)), .
  • dispatchLoopShutdown() , Zend_Controller_Front .

, dispatchLoopShutdown() - , - , Zend_Controller_Front::dispatch() .

, - , Zend_View. Zend_View Zend_View::render(). - , filter($buffer), $buffer. -, Ouptut, , .

, dispatchLoopShutdown() -plugin.

+9

Source: https://habr.com/ru/post/1722782/


All Articles