PHP 클래스 yii\web\HttpException

HttpException can be differentiated via its [[statusCode]] property value which keeps a standard HTTP status code (e.g. 404, 500). Error handlers may use this status code to decide how to format the error page. Throwing an HttpException like in the following example will result in the 404 page to be displayed. php if ($item === null) { // item does not exist throw new \yii\web\HttpException(404, 'The requested Item could not be found.'); }
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends yii\base\UserException
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$statusCode HTTP status code, such as 403, 404, 500, etc.

공개 메소드들

메소드 설명
__construct ( integer $status, string $message = null, integer $code, Exception $previous = null ) Constructor.
getName ( ) : string

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( integer $status, string $message = null, integer $code, Exception $previous = null )
$status integer HTTP status code, such as 404, 500, etc.
$message string error message
$code integer error code
$previous Exception The previous exception used for the exception chaining.

getName() 공개 메소드

public getName ( ) : string
리턴 string the user-friendly name of this exception

프로퍼티 상세

$statusCode 공개적으로 프로퍼티

HTTP status code, such as 403, 404, 500, etc.
public $statusCode