We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Output buffer?

So, how to clean output from phalcon.

Tried all ob_* functions = nothing. Tried flush(); - nothing.


try ob_flush() , but after line where you are outputting content

edited Jun '14

Still nothing. Even if I'm doing like:

ob_start(); echo 123; ob_flush();

it still prints 123. Is phalcon using other output buffering?

yes, output buffering is enabled by default ... are you having problem to output something or to not output ? maybe i didnt understand you well


I`ve problems disabling output. Tried to disable it everywhere, starting from controllers till views, and index.php, but still phalcon generates output...

Output buffers can be nested so try:

while (ob_get_level()) ob_end_flush();

I just had the same problem. It looks like Phalcon flushes the current output buffer level and creates it's own when starting the dispatch loop. This looks strange, but it works for me:

<do you stuff>
$output = ob_get_clean();

Best Fabian