We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Strange behaviour of view/dispatcher

Hi! I have problem with long duration script:

Controller TEST, action TEST contains this code:

$this->view->disable();

sleep(60*20);

echo 'testBLABLA';

After 13-15 minutes, page renders as code from controller INDEX action INDEX and there is no 'testBLABLA' in content. It looks like a dispatch to main page... I thought when i write this:

$this->view->disable();

There will be no content from views/layout. Any ideas why it happens?

edited Jul '15

Well... Try it with a just a few seconds to see the results (5 for example)... i test that and got 'testBLABLA' printed. I think in your case is PHP limitation about script execution or something. Check out PHP documentation for "set time limit" or "max execution time".

Good luck

if you want to see the prints, echoes, var_dumps etc from your action you must write {{ content() }} on your template (if you are using volt and not disabling the view)