Zend Framework - call something at the end of building a page
Hi I would like to call a method at the end of a page generation using Zend Framework. How to do this?
I am using Doctrine2 + ZF. The EntityManager has a flush method, which should in the common cases only be called at the end of the page generation. Is there a hook or开发者_Go百科 a destructor emulation in Zend Framework? 2
Use a controller plugin. I assume the dispatchLoopShutdown is what you need.
Why just don't use your own function?
call register_shutdown_function();
and the passed function will be executed at the end of the script
精彩评论