diff options
author | wei <> | 2006-06-15 00:56:57 +0000 |
---|---|---|
committer | wei <> | 2006-06-15 00:56:57 +0000 |
commit | 67e09d150afe55d7a956beb299dc0534f7da68eb (patch) | |
tree | 793669c130d7cb17b56b75fb42fe1fac07c5fccc /framework/Web/THttpResponseAdapter.php | |
parent | 469fe68e8a08330cb0ed8b56f758bee8d7c9445e (diff) |
Update active controls. Add comments. Add THttpResponseAdapter
Diffstat (limited to 'framework/Web/THttpResponseAdapter.php')
-rw-r--r-- | framework/Web/THttpResponseAdapter.php | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/framework/Web/THttpResponseAdapter.php b/framework/Web/THttpResponseAdapter.php new file mode 100644 index 00000000..6931eda8 --- /dev/null +++ b/framework/Web/THttpResponseAdapter.php @@ -0,0 +1,69 @@ +<?php +/** + * THttpResponseAdatper class + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005 PradoSoft + * @license http://www.pradosoft.com/license/ + * @version $Revision: $ $Date: $ + * @package System.Web + */ + +/** + * THttpResponseAdapter class. + * + * THttpResponseAdapter allows the base http response class to change behaviour + * without change the class hierachy. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @version : $ Fri Jun 16 07:03:03 EST 2006 $ + * @package System.Web + * @since 3.0 + */ +class THttpResponseAdapter extends TApplicationComponent +{ + /** + * @var THttpResponse the response object the adapter is attached. + */ + private $_response; + + /** + * Constructor. Attach a response to be adapted. + * @param THttpResponse the response object the adapter is to attach to. + */ + public function __construct($response) + { + $this->_response=$response; + } + + /** + * @return THttpResponse the response object adapted. + */ + public function getResponse() + { + return $this->_response; + } + + /** + * This method is invoked when the response flushes the content and headers. + * Default implementation calls the attached response flushContent method. + */ + public function flushContent() + { + $this->_response->flushContent(); + } + + /** + * This method is invoked when a new HtmlWriter needs to be created. + * Default implementation calls the attached response createNewHtmlWriter method. + * @param string type of the HTML writer to be created. + * @param ITextWriter the writer responsible for holding the content. + */ + public function createNewHtmlWriter($type, $writer) + { + return $this->_response->createNewHtmlWriter($type,$writer); + } +} + +?>
\ No newline at end of file |