CHttpException

Package system.base
Inheritance class CHttpException » CException » Exception
Since 1.0
Source Code framework/base/CHttpException.php
CHttpException represents an exception caused by invalid operations of end-users.

The HTTP error code can be obtained via statusCode. Error handlers may use this status code to decide how to format the error page.

Public Properties

Property Type Description Defined By
statusCode integer HTTP status code, such as 403, 404, 500, etc. CHttpException

Protected Properties

Property Type Description Defined By
code Exception
file Exception
line Exception
message Exception

Public Methods

Method Description Defined By
__construct() Constructor. CHttpException
__toString() Exception
__wakeup() Exception
getCode() Exception
getFile() Exception
getLine() Exception
getMessage() Exception
getPrevious() Exception
getTrace() Exception
getTraceAsString() Exception

Property Details

statusCode property

public integer $statusCode;

HTTP status code, such as 403, 404, 500, etc.

Method Details

__construct() method

public void __construct(integer $status, string $message=NULL, integer $code=0)
$status integer HTTP status code, such as 404, 500, etc.
$message string error message
$code integer error code
Source Code: framework/base/CHttpException.php#34 (show)
public function __construct($status,$message=null,$code=0)
{
    
$this->statusCode=$status;
    
parent::__construct($message,$code);
}

Constructor.

© 2008–2017 by Yii Software LLC
Licensed under the three clause BSD license.
http://www.yiiframework.com/doc/api/1.1/CHttpException