Skip to content
PHP Ecosystem
Explore

NotFoundHttpException

API reference › yii › web › NotFoundHttpException

classyii\web\NotFoundHttpException
ExtendsHttpException » yii\base\UserException » yii\base\Exception » Exception
Since2.0
Sourceframework/web/NotFoundHttpException.php

NotFoundHttpException represents a “Not Found” HTTP exception with status code 404.

See also: https://tools.ietf.org/html/rfc7231#section-6.5.4.

PropertyTypeDescriptionDefined by
$statusCodeintHTTP status code, such as 403, 404, 500, etc. Default: null.HttpException
MethodDescriptionDefined by
__construct()Constructor.NotFoundHttpException
getName()HttpException
public function __construct(string|null $message = null, int $code = 0, Throwable|null $previous = null)

Constructor.

Parameters

ParameterTypeDescription
$messagestring|nullError message
$codeintError code
$previousThrowable|nullThe previous exception used for the exception chaining.