数据未通过yii2中的模型保存(Data not saving through model in yii2)

编程入门 行业动态 更新时间:2024-10-28 11:24:52
数据未通过yii2中的模型保存(Data not saving through model in yii2)

我是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

更多推荐

本文发布于:2023-07-31 15:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1345306.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模型   数据   model   Data   saving

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!