3 * TFlushOutput class file
5 * @author Berczi Gabor <gabor.berczi@devworx.hu>
6 * @link https://github.com/pradosoft/prado
7 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
8 * @package System.Web.UI.WebControls
14 * TFlushOutput enables forced flushing of the current output buffer
15 * at (a) certain point(s) in the page, after rendering of all previous
16 * controls has been completed.
18 * To use TFlushOutput, simply place it in a template where you want
19 * the have the output buffered between the start of the page or the
20 * last TFlushOutput to be sent to the client immediately
22 * <com:TFlushOutput />
25 * You can specify whether you want to keep buffering of the output
26 * (if it was enabled) till the next occourence of a <com: TFlushOutput />
27 * or the end of the page rendering, or stop buffering, by using the
28 * {@link setContinueBuffering ContinueBuffering}.
30 * @author Berczi Gabor <gabor.berczi@devworx.hu>
31 * @package System.Web.UI.WebControls
34 class TFlushOutput extends TControl
37 * @var boolean whether to continue buffering of output
39 private $_continueBuffering=true;
45 public function __construct()
47 parent::__construct();
48 $this->EnableViewState = false;
52 * @return Tells whether buffering of output can continue after this point
54 public function getContinueBuffering()
56 return $this->_continueBuffering;
60 * @param boolean sets whether buffering of output can continue after this point
62 public function setContinueBuffering($value)
64 $this->_continueBuffering = TPropertyValue::ensureBoolean($value);
68 * Flushes the output of all completely rendered controls to the client.
69 * @param THtmlWriter writer for the rendering purpose
71 public function render($writer)
73 //$writer->write('<!-- flush -->');
74 // ajax responses can't be parsed by the client side before loaded and returned completely,
75 // so don't bother with flushing output somewhere mid-page if refreshing in a callback
76 if (!$this->Page->IsCallback)
78 $this->Page->flushWriter();
79 // $this->Application->flushOutput($this->ContinueBuffering);