//控制器接收异常
try {
$res = D($model)->del($id);
}catch (\Exception $e) { //如书写为(Exception $e)将无效
echo $e->getMessage();
}
Thinkphp try{}catch()异常处理的写法
最新推荐文章于 2023-06-23 00:10:30 发布
//控制器接收异常
try {
$res = D($model)->del($id);
}catch (\Exception $e) { //如书写为(Exception $e)将无效
echo $e->getMessage();
}