diff options
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/Services/TPageService.php | 4 | ||||
-rw-r--r-- | framework/Web/THttpResponse.php | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 239cf870..463f2dec 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -455,9 +455,7 @@ class TPageService extends TService else
throw new THttpException(404,'pageservice_page_unknown',$this->_pagePath);
- $writer=$this->getResponse()->createHtmlWriter();
- $this->_page->run($writer);
- $writer->flush();
+ $this->_page->run($this->getResponse()->createHtmlWriter());
}
/**
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index 1cbf9751..d64a82af 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -297,6 +297,18 @@ class THttpResponse extends TModule implements ITextWriter }
/**
+ * Returns the content in the output buffer.
+ * The buffer will NOT be cleared after calling this method.
+ * Use {@link clear()} is you want to clear the buffer.
+ * @return string output that is in the buffer.
+ */
+ public function getContents()
+ {
+ Prado::trace("Retrieving output",'System.Web.THttpResponse');
+ return $this->_bufferOutput?ob_get_contents():'';
+ }
+
+ /**
* Clears any existing buffered content.
*/
public function clear()
|