From 75aae8e4df2a5bbc1e6f232951d62fa097280160 Mon Sep 17 00:00:00 2001 From: denis Date: Wed, 11 Oct 2023 13:44:21 +0300 Subject: [PATCH] api-registration addition --- .../api/controllers/RegisterController.php | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 frontend/modules/api/controllers/RegisterController.php diff --git a/frontend/modules/api/controllers/RegisterController.php b/frontend/modules/api/controllers/RegisterController.php new file mode 100644 index 0000000..fa5a403 --- /dev/null +++ b/frontend/modules/api/controllers/RegisterController.php @@ -0,0 +1,71 @@ +load(Yii::$app->getRequest()->getBodyParams(), '')) { + /** @var User $user */ + if ($user = $model->signup()) { + return [ + 'id' => $user->id, + ]; + } + } + + return null; + } +}