I want to write a simple rpg.
I use yii 2 user, which on the move creates 7 tables.
while all this in the user module
I want to throw the game in modules \ game
logically, you could have 2 bases - for the game and for the user, but then the foreign keys will not work.
how to be? Is it possible to forward communication between modules? or just create a my_user model in the module and, at the first registration, create an entry for the user with his id and name?
How is this correctly implemented?
game, a getter is written in the desired model of the model.public function getUser() { return $this->hasOne('app\modules\users\models\User', array('id' => 'user_id')); }public function getUser() { return $this->hasOne('app\modules\users\models\User', array('id' => 'user_id')); }... since in the second connection,yiiare made as setters and getters ... look here, the same person says: habrahabr.ru/post/185236 - Alexey Shimansky