summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TCallbackResponse.php
diff options
context:
space:
mode:
authorwei <>2006-05-04 02:02:43 +0000
committerwei <>2006-05-04 02:02:43 +0000
commit75a0a250cc6735d13b3b782daf0127298b37c2b9 (patch)
treefc9a1a0b28022d573097dcc7e71b29dfe6c5821f /framework/Web/UI/ActiveControls/TCallbackResponse.php
parentd255f4d0e332740b3984e21ce3f7a4a4f1968ba3 (diff)
Adding TCallback component.
Diffstat (limited to 'framework/Web/UI/ActiveControls/TCallbackResponse.php')
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackResponse.php45
1 files changed, 43 insertions, 2 deletions
diff --git a/framework/Web/UI/ActiveControls/TCallbackResponse.php b/framework/Web/UI/ActiveControls/TCallbackResponse.php
index a05c20c7..4a893b9a 100644
--- a/framework/Web/UI/ActiveControls/TCallbackResponse.php
+++ b/framework/Web/UI/ActiveControls/TCallbackResponse.php
@@ -11,9 +11,50 @@
class TCallbackResponse extends THttpResponse
{
+ private $_writers=array();
+ public function createHtmlWriter($type=null)
+ {
+ $writer = new TCallbackResponseWriter();
+ $this->_writers[] = $writer;
+ if($type===null)
+ $type=$this->getHtmlWriterType();
+ return Prado::createComponent($type,$writer);
+ }
+
+ public function flush()
+ {
+ foreach($this->_writers as $writer)
+ echo $writer->flush();
+ parent::flush();
+ }
}
-
-
+class TCallbackResponseWriter extends TTextWriter
+{
+ private $_boundary;
+
+ public function __construct()
+ {
+ $this->_boundary = sprintf('%x',crc32((string)$this));
+ }
+
+ public function getBoundary()
+ {
+ return $this->_boundary;
+ }
+
+ public function setBoundary($value)
+ {
+ $this->_boundary = $value;
+ }
+
+ public function flush()
+ {
+ $content = '<!--'.$this->getBoundary().'-->';
+ $content .= parent::flush();
+ $content .= '<!--//'.$this->getBoundary().'-->';
+ return $content;
+ }
+}
?>