应为数据库表的结构被缓存了。删除runtime文件夹或者执行
//清理指定表结构缓存数据Yii::$app->db->getSchema()->refreshTableSchema('{{%post}}');//这里post是出去表前缀的表名//清理所有表结构缓存数据Yii::$app->db->getSchema()->refresh();
完成!
学习教程推荐:yii框架
以上就是yii2给数据库表新增字段后对应模型无法识别到该属性的知识。速戳>>知识兔学习精品课!
点击领取支付宝红包
点击下载免费精品课