YII 数据插入 save() 方法

案例:

$country = new Country;
$country->code = "AB";
$country->name = "name";
$country->population = 123;
var_dump($country->save());
var_dump($country->errors);

 

可以通过

$model->errors 查看错误的原因

posted @ 2020-03-10 20:21  GetcharZp  阅读(578)  评论(0编辑  收藏  举报