Код: Выделить всё
return $data = $model ? : new NotFoundException();
а нужно 404 и{
"statusCode": 404
}
{
"name": "Not Found",
"message": "Data not Found",
"code": 0,
"status": 404,
"type": "yii\\web\\NotFoundHttpException"
}
Код: Выделить всё
return $data = $model ? : new NotFoundException();
а нужно 404 и{
"statusCode": 404
}
{
"name": "Not Found",
"message": "Data not Found",
"code": 0,
"status": 404,
"type": "yii\\web\\NotFoundHttpException"
}
Код: Выделить всё
throw new HttpException(404, 'The requested page does not exist.')
в тернарный оператор так не вставитьunknownby писал(а): ↑2020.04.30, 08:28 Что если так?Код: Выделить всё
throw new HttpException(404, 'The requested page does not exist.')