开发者

CodeIgniter Design Of Model

开发者 https://www.devze.com 2023-03-09 23:45 出处:网络
I have a user model that has properties such as username, password, first name, last name, address...etc

I have a user model that has properties such as username, password, first name, last name, address...etc

What is the best w开发者_如何学运维ay to have these properties set on the model so I can insert or update into the database?

Should I have add, update..ect methods that take a whole list of parameters or just an array.

My questions is: How would you write a simple User model with the above fields in CI?


One way is using CodeIgniter's models which I find rather anoying. CodeIgniter will just provide a Db object and you'll probably end up doing queries into the database.

I use another way, with CI project I use Propel, which is an ORM (basically what you want to do) and it's relatively easy to integrate, you can get an integration guide I wrote here.

Hope I can help!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号