Answer the question
In order to leave comments, you need to log in
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
Очень непонятно написано, предположу, что вы, как и многие на тостере, просто не умеете читать документацию (вообще туда смотрите?).
Ответ кроется тут: 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 questionAsk a Question
731 491 924 answers to any question