我是Yii2框架的新手。
我正在创建一个自定义表单并将其数据保存到表中。 我尝试了这里或Google上的所有解决方案。
我真的很沮丧。 任何人都可以解决或解决这个问题吗? 如果您需要,我也可以为您提供网站的代码或访问权限。
I am newbie to the Yii2 framework.
I am creating a custom form and saving its data to a table. I tried every solution that is here or on Google.
I am really getting frustrated. Can anybody solve or give solution to this problem? If you need I can give you the code or access of the site as well.
最满意答案
您无法使用form model将数据保存到数据库中
刚刚在yii中引入的form model来收集用户数据。 稍后将使用该数据然后丢弃。 它无法将数据保存到数据库中。
要保存数据,您应该使用Active Records
You cannot save the data into database using form model
form model just introduced in yii to collect the user data. Later this data will be used and then discarded. It can not save the data into database.
To save the data, you should use Active Records
更多推荐
发布评论