summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-04-29 12:58:06 +0000
committerxue <>2006-04-29 12:58:06 +0000
commit3281c0a025a645ee79bf01eac142163ec9357690 (patch)
treebf26b8533d8894b216f7b7a00a426f7ab529fb3c
parentb97d6a698d80d946e3669595e8d87f0c378b3520 (diff)
Added THttpResponse::reload().
-rw-r--r--HISTORY1
-rw-r--r--framework/Exceptions/TErrorHandler.php6
-rw-r--r--framework/Web/THttpResponse.php10
3 files changed, 14 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index af4f0f01..14c81b0c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -17,6 +17,7 @@ ENH: TButtonColumn can now be a column of image buttons (Qiang)
ENH: TLiteral will display body content if Text is empty (Qiang)
ENH: Format string in classes extending TDataGridColumn can now evaluate an expression (Qiang)
ENH: Format string in classes extending TListControl can now evaluate an expression (Qiang)
+ENH: Added THttpResponse::reload() (Qiang)
ENH: Custom visual effects can be added to client-side validators. (Wei)
ENH: TJavascript::encode() allows raw javascript code when string begins with "javascript:" (Wei)
ENH: Update TinyMCE to 2.0.5.1
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php
index 4b42491e..25f421e3 100644
--- a/framework/Exceptions/TErrorHandler.php
+++ b/framework/Exceptions/TErrorHandler.php
@@ -214,10 +214,10 @@ class TErrorHandler extends TModule
// if PHP exception, we want to show the 2nd stack level context
// because the 1st stack level is of little use (it's in error handler)
$trace=$exception->getTrace();
- if(isset($trace[0]) && isset($trace[0]['file']) && isset($trace[0]['line']))
+ if(isset($trace[1]) && isset($trace[1]['file']) && isset($trace[1]['line']))
{
- $fileName=$trace[0]['file'];
- $errorLine=$trace[0]['line'];
+ $fileName=$trace[1]['file'];
+ $errorLine=$trace[1]['line'];
}
}
$lines=file($fileName);
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index 261c34ed..ce4bf4b1 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -285,6 +285,16 @@ class THttpResponse extends TModule implements ITextWriter
}
/**
+ * Reloads the current page.
+ * The effect of this method call is the same as user pressing the
+ * refresh button on his browser (without post data).
+ **/
+ public function reload()
+ {
+ $this->redirect($this->getRequest()->getRequestUri());
+ }
+
+ /**
* Outputs the buffered content, sends content-type and charset header.
*/
public function flush()