为了账号安全,请及时绑定邮箱和手机立即绑定

yii框架使用model出现 table does not exist的解决办法?

yii框架使用model出现 table does not exist的解决办法?

Yii
缥缈止盈 2018-12-07 14:11:33
数据库已经建好并改好main.php中的参数,但是使用gii Model Generator时会出现table does not exist。
查看完整描述

1 回答

?
万千封印

TA贡献1891条经验 获得超3个赞

在相应的model中添加该方法:
/**
* {@inheritdoc}
*/
public static function tableName()
{
return '{{%table_name}}';
}

查看完整回答
反对 回复 2019-01-07
  • 1 回答
  • 0 关注
  • 846 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信