24 changed files with 822 additions and 798 deletions
@ -0,0 +1,40 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* @link http://www.yiiframework.com/ |
||||||
|
* @copyright Copyright (c) 2008 Yii Software LLC |
||||||
|
* @license http://www.yiiframework.com/license/ |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace yii\base; |
||||||
|
|
||||||
|
/** |
||||||
|
* ResponseEvent represents the event data for the [[Application::EVENT_RESPONSE]] event. |
||||||
|
* |
||||||
|
* Event handlers can modify the content in [[response]] or replace [[response]] |
||||||
|
* with a new response object. The updated or new response will |
||||||
|
* be used as the final out of the application. |
||||||
|
* |
||||||
|
* @author Qiang Xue <qiang.xue@gmail.com> |
||||||
|
* @since 2.0 |
||||||
|
*/ |
||||||
|
class ResponseEvent extends Event |
||||||
|
{ |
||||||
|
/** |
||||||
|
* @var Response the response object associated with this event. |
||||||
|
* You may modify the content in this response or replace it |
||||||
|
* with a new response object. The updated or new response will |
||||||
|
* be used as the final out. |
||||||
|
*/ |
||||||
|
public $response; |
||||||
|
|
||||||
|
/** |
||||||
|
* Constructor. |
||||||
|
* @param Response $response the response object associated with this event. |
||||||
|
* @param array $config the configuration array for initializing the newly created object. |
||||||
|
*/ |
||||||
|
public function __construct($response, $config = array()) |
||||||
|
{ |
||||||
|
$this->response = $response; |
||||||
|
parent::__construct($config); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,66 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* @var \Exception $exception |
||||||
|
* @var \yii\base\ErrorHandler $context |
||||||
|
*/ |
||||||
|
$context = $this->context; |
||||||
|
$title = $context->htmlEncode($exception instanceof \yii\base\Exception ? $exception->getName() : get_class($exception)); |
||||||
|
?> |
||||||
|
<!DOCTYPE html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8" /> |
||||||
|
<title><?php echo $title?></title>
|
||||||
|
|
||||||
|
<style> |
||||||
|
body { |
||||||
|
font: normal 9pt "Verdana"; |
||||||
|
color: #000; |
||||||
|
background: #fff; |
||||||
|
} |
||||||
|
|
||||||
|
h1 { |
||||||
|
font: normal 18pt "Verdana"; |
||||||
|
color: #f00; |
||||||
|
margin-bottom: .5em; |
||||||
|
} |
||||||
|
|
||||||
|
h2 { |
||||||
|
font: normal 14pt "Verdana"; |
||||||
|
color: #800000; |
||||||
|
margin-bottom: .5em; |
||||||
|
} |
||||||
|
|
||||||
|
h3 { |
||||||
|
font: bold 11pt "Verdana"; |
||||||
|
} |
||||||
|
|
||||||
|
p { |
||||||
|
font: normal 9pt "Verdana"; |
||||||
|
color: #000; |
||||||
|
} |
||||||
|
|
||||||
|
.version { |
||||||
|
color: gray; |
||||||
|
font-size: 8pt; |
||||||
|
border-top: 1px solid #aaa; |
||||||
|
padding-top: 1em; |
||||||
|
margin-bottom: 1em; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<h1><?php echo $title?></h1>
|
||||||
|
<h2><?php echo nl2br($context->htmlEncode($exception->getMessage()))?></h2>
|
||||||
|
<p> |
||||||
|
The above error occurred while the Web server was processing your request. |
||||||
|
</p> |
||||||
|
<p> |
||||||
|
Please contact us if you think this is a server error. Thank you. |
||||||
|
</p> |
||||||
|
<div class="version"> |
||||||
|
<?php echo date('Y-m-d H:i:s', time())?> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
Loading…
Reference in new issue