CHttpException.php 990 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * CHttpException class file.
  4. *
  5. * @author Qiang Xue <qiang.xue@gmail.com>
  6. * @link http://www.yiiframework.com/
  7. * @copyright 2008-2013 Yii Software LLC
  8. * @license http://www.yiiframework.com/license/
  9. */
  10. /**
  11. * CHttpException represents an exception caused by invalid operations of end-users.
  12. *
  13. * The HTTP error code can be obtained via {@link statusCode}.
  14. * Error handlers may use this status code to decide how to format the error page.
  15. *
  16. * @author Qiang Xue <qiang.xue@gmail.com>
  17. * @package system.base
  18. * @since 1.0
  19. */
  20. class CHttpException extends CException
  21. {
  22. /**
  23. * @var integer HTTP status code, such as 403, 404, 500, etc.
  24. */
  25. public $statusCode;
  26. /**
  27. * Constructor.
  28. * @param integer $status HTTP status code, such as 404, 500, etc.
  29. * @param string $message error message
  30. * @param integer $code error code
  31. */
  32. public function __construct($status,$message=null,$code=0)
  33. {
  34. $this->statusCode=$status;
  35. parent::__construct($message,$code);
  36. }
  37. }