G
G
Greg Popov2016-08-22 12:45:26
Yii
Greg Popov, 2016-08-22 12:45:26

Which is Yii2 best practice save method in Model?

Hello.
Suppose there are User && UserProfile models.
Where can I see an example of the correct implementation of save in the User model?
The application has many registration points (social networks or classic), at the moment the idea is this: write your own rules for each of the possible scenarios, apply this scenario depending on the type of registration, and simply call signup () from the model in the controller, which according to the specified scenario, it will pull out some data from the form or from a certain social network and write it to two models: User && UserProfile, respectively, the problem is in the technically correct implementation of the signup () method in the User model, which, according to the established scenario, will write to two models (in itself and UserProfile)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Никита, 2016-08-22
@bitver

Очень непонятно написано, предположу, что вы, как и многие на тостере, просто не умеете читать документацию (вообще туда смотрите?).
Ответ кроется тут: https://github.com/yiisoft/yii2-authclient/blob/ma...
И тут, если не додумаетесь прочитать следующие странички: https://github.com/yiisoft/yii2-authclient/blob/ma...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question