itaym02 Posted September 23, 2009 Share Posted September 23, 2009 The scenario: A "forgot my password" for is filled with email. On submission email is sent to the user. Due to the way ZF is working, the email is sent in the controller, before anything is thrown to the browser. This makes it look like after the submission the site is stuck (if it takes a long time to send the email). Is there a way to echo a message to the screen, on the lines "Your request is being taken care of...". I can use AJAX to submit this request, I can use cron to send the emails at a later time... But I was wondering if there is a good way to do it built in ZF? Quote Link to comment https://forums.phpfreaks.com/topic/175268-how-to-render-part-of-a-view-before-all-the-controller-code-ends/ Share on other sites More sharing options...
Zyx Posted September 24, 2009 Share Posted September 24, 2009 AFAIK the built-in compontents do not give you such a possibility, but you can extend it. Write your own response class with the outputBody() method overloaded: public function outputBody() { parent::outputBody(); flush(); } Once you set it, outputBody() will be flushing the data to the browser and then you'll have to prepare the views and rendering them in the controller. Quote Link to comment https://forums.phpfreaks.com/topic/175268-how-to-render-part-of-a-view-before-all-the-controller-code-ends/#findComment-923957 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.