阅读背景:

自动添加外键(已登录用户的用户ID)

来源:互联网 

i am a newbie in programming with cakephp, so i have implemented an simple user-game application. There is an "hasMany" relation between users and game. A game is created exactly by one user. Therefore there is a field in the model of game, named "user_id". I am already using the auth component and it is possible that user can login to the system. Now, i want that user can add games to the model, but the user_id should be added automatically( by acessing to session data). How i can achieve that ?i am a newbie in programming with cakephp, so i




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: