[eluser]Unknown[/eluser]
Hi,
I'm wondering how to implement flushing of content with code ignitor.
In previous (non CI) work I've done something along the lines of:
Code:
ob_start("ob_gzhandler");
include 'header.inc.php';
@ob_flush();
flush();
// do some work
include 'footer.inc.php';
In addition to the improved page loading time, it's some time useful when doing long tasks (sending email, complicated DB queries etc.) to:
* output head content
* display a busy image
* flush
* do the the task
* output "task complete" with a bit of javascript that hides the busy image.
Within CI simply trying ob_flush() etc after loading a view simply doesn't work, as CI is using (multiple ?) output buffers behind the scenes (to deal with nested views IINM).
I can do a nasty hack of loading the header view, echoing the output buffer, flushing, emptying the output buffer, then load the main view etc., but:
* This is nasty
* It breaks as soon as output compression is enabled in the config.
Anyone got ideas where I start? I imagine I need to extend the output class and/or write some hooks, but at the moment I'm not sure where to start.
TIA,
Pheet