mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 13:58:55 +08:00
phpdoc
This commit is contained in:
@ -51,6 +51,7 @@ class ErrorHandler extends Component
|
||||
|
||||
|
||||
/**
|
||||
* Handles exception
|
||||
* @param \Exception $exception
|
||||
*/
|
||||
public function handle($exception)
|
||||
@ -64,6 +65,10 @@ class ErrorHandler extends Component
|
||||
$this->renderException($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders exception
|
||||
* @param \Exception $exception
|
||||
*/
|
||||
protected function renderException($exception)
|
||||
{
|
||||
if ($this->errorAction !== null) {
|
||||
@ -196,6 +201,10 @@ class ErrorHandler extends Component
|
||||
echo '<div class="code"><pre>' . $output . '</pre></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders calls stack trace
|
||||
* @param array $trace
|
||||
*/
|
||||
public function renderTrace($trace)
|
||||
{
|
||||
$count = 0;
|
||||
@ -233,6 +242,11 @@ class ErrorHandler extends Component
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts special characters to HTML entities
|
||||
* @param string $text text to encode
|
||||
* @return string
|
||||
*/
|
||||
public function htmlEncode($text)
|
||||
{
|
||||
return htmlspecialchars($text, ENT_QUOTES, \Yii::$app->charset);
|
||||
|
||||
@ -13,27 +13,45 @@ namespace yii\base;
|
||||
*/
|
||||
class Response extends Component
|
||||
{
|
||||
/**
|
||||
* Starts output buffering
|
||||
*/
|
||||
public function beginOutput()
|
||||
{
|
||||
ob_start();
|
||||
ob_implicit_flush(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns contents of the output buffer and discards it
|
||||
* @return string output buffer contents
|
||||
*/
|
||||
public function endOutput()
|
||||
{
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns contents of the output buffer
|
||||
* @return string output buffer contents
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
return ob_get_contents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Discards the output buffer
|
||||
*/
|
||||
public function cleanOutput()
|
||||
{
|
||||
ob_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Discards the output buffer
|
||||
* @param boolean $all if true recursively discards all output buffers used
|
||||
*/
|
||||
public function removeOutput($all = true)
|
||||
{
|
||||
if ($all) {
|
||||
|
||||
Reference in New Issue
Block a user