PHP 클래스 yii\web\ErrorHandler

ErrorHandler displays these errors using appropriate views based on the nature of the errors and the mode the application runs at. ErrorHandler is configured as an application component in Application by default. You can access that instance via Yii::$app->errorHandler. For more details and usage information on ErrorHandler, see the guide article on handling errors.
부터: 2.0
저자: Qiang Xue ([email protected])
저자: Timur Ruziev ([email protected])
상속: extends yii\base\ErrorHandler
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$callStackItemView the path of the view file for rendering exceptions and errors call stack element.
$displayVars list of the PHP predefined variables that should be displayed on the error page. Note that a variable must be accessible via $GLOBALS. Otherwise it won't be displayed. Defaults to ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION'].
$errorAction the route (e.g. site/error) to the controller action that will be used to display external errors. Inside the action, it can retrieve the error information using Yii::$app->errorHandler->exception. This property defaults to null, meaning ErrorHandler will handle the error display.
$errorView the path of the view file for rendering exceptions without call stack information.
$exceptionView the path of the view file for rendering exceptions.
$maxSourceLines maximum number of source code lines to be displayed. Defaults to 19.
$maxTraceSourceLines maximum number of trace source code lines to be displayed. Defaults to 13.
$previousExceptionView the path of the view file for rendering previous exceptions.

공개 메소드들

메소드 설명
addTypeLinks ( string $code ) : string Adds informational links to the given PHP type/class.
argumentsToString ( array $args ) : string Converts arguments array to its string representation
createFrameworkVersionLink ( ) : string Creates string containing HTML link which refers to the page with the current version of the framework and version number text.
createHttpStatusLink ( integer $statusCode, string $statusDescription ) : string Creates HTML containing link to the page with the information on given HTTP status code.
createServerInformationLink ( ) : string Creates string containing HTML link which refers to the home page of determined web-server software and its full name.
getExceptionName ( Exception $exception ) : string Returns human-readable exception name
htmlEncode ( string $text ) : string Converts special characters to HTML entities.
isCoreFile ( string $file ) : boolean Determines whether given name of the file belongs to the framework.
renderCallStackItem ( string | null $file, integer | null $line, string | null $class, string | null $method, array $args, integer $index ) : string Renders a single call stack element.
renderFile ( string $_file_, array $_params_ ) : string Renders a view file as a PHP script.
renderPreviousExceptions ( Exception $exception ) : string Renders the previous exception stack for a given Exception.
renderRequest ( ) : string Renders the global variables of the request.

보호된 메소드들

메소드 설명
convertExceptionToArray ( Exception $exception ) : array Converts an exception into an array.
getTypeUrl ( string $class, string | null $method ) : string | null Returns the informational link URL for a given PHP type/class.
renderException ( Exception $exception ) Renders the exception.

메소드 상세

argumentsToString() 공개 메소드

Converts arguments array to its string representation
public argumentsToString ( array $args ) : string
$args array arguments array to be converted
리턴 string string representation of the arguments array

convertExceptionToArray() 보호된 메소드

Converts an exception into an array.
protected convertExceptionToArray ( Exception $exception ) : array
$exception Exception the exception being converted
리턴 array the array representation of the exception.

getExceptionName() 공개 메소드

Returns human-readable exception name
public getExceptionName ( Exception $exception ) : string
$exception Exception
리턴 string human-readable exception name or null if it cannot be determined

getTypeUrl() 보호된 메소드

Returns the informational link URL for a given PHP type/class.
또한 보기: addTypeLinks()
protected getTypeUrl ( string $class, string | null $method ) : string | null
$class string the type or class name.
$method string | null the method name.
리턴 string | null the informational link URL.

htmlEncode() 공개 메소드

Converts special characters to HTML entities.
public htmlEncode ( string $text ) : string
$text string to encode.
리턴 string encoded original text.

isCoreFile() 공개 메소드

Determines whether given name of the file belongs to the framework.
public isCoreFile ( string $file ) : boolean
$file string name to be checked.
리턴 boolean whether given name of the file belongs to the framework.

renderCallStackItem() 공개 메소드

Renders a single call stack element.
public renderCallStackItem ( string | null $file, integer | null $line, string | null $class, string | null $method, array $args, integer $index ) : string
$file string | null name where call has happened.
$line integer | null number on which call has happened.
$class string | null called class name.
$method string | null called function/method name.
$args array array of method arguments.
$index integer number of the call stack element.
리턴 string HTML content of the rendered call stack element.

renderException() 보호된 메소드

Renders the exception.
protected renderException ( Exception $exception )
$exception Exception the exception to be rendered.

renderFile() 공개 메소드

Renders a view file as a PHP script.
public renderFile ( string $_file_, array $_params_ ) : string
$_file_ string the view file.
$_params_ array the parameters (name-value pairs) that will be extracted and made available in the view file.
리턴 string the rendering result

renderPreviousExceptions() 공개 메소드

Renders the previous exception stack for a given Exception.
public renderPreviousExceptions ( Exception $exception ) : string
$exception Exception the exception whose precursors should be rendered.
리턴 string HTML content of the rendered previous exceptions. Empty string if there are none.

renderRequest() 공개 메소드

List of global variables is defined in [[displayVars]].
또한 보기: displayVars
public renderRequest ( ) : string
리턴 string the rendering result

프로퍼티 상세

$callStackItemView 공개적으로 프로퍼티

the path of the view file for rendering exceptions and errors call stack element.
public $callStackItemView

$displayVars 공개적으로 프로퍼티

list of the PHP predefined variables that should be displayed on the error page. Note that a variable must be accessible via $GLOBALS. Otherwise it won't be displayed. Defaults to ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION'].
또한 보기: renderRequest()
부터: 2.0.7
public $displayVars

$errorAction 공개적으로 프로퍼티

the route (e.g. site/error) to the controller action that will be used to display external errors. Inside the action, it can retrieve the error information using Yii::$app->errorHandler->exception. This property defaults to null, meaning ErrorHandler will handle the error display.
public $errorAction

$errorView 공개적으로 프로퍼티

the path of the view file for rendering exceptions without call stack information.
public $errorView

$exceptionView 공개적으로 프로퍼티

the path of the view file for rendering exceptions.
public $exceptionView

$maxSourceLines 공개적으로 프로퍼티

maximum number of source code lines to be displayed. Defaults to 19.
public $maxSourceLines

$maxTraceSourceLines 공개적으로 프로퍼티

maximum number of trace source code lines to be displayed. Defaults to 13.
public $maxTraceSourceLines

$previousExceptionView 공개적으로 프로퍼티

the path of the view file for rendering previous exceptions.
public $previousExceptionView