[ 'class' => AccessControl::className(), 'only' => ['register'], 'rules' => [ [ 'actions' => ['register'], 'allow' => true, 'roles' => ['?'], ], ], ], ]); } public function actionRegister() { $model = new RegistrationForm(); $model->load(Yii::$app->request->post()); if (!$model->signup()) { return [ 'success' => false, 'errors' => $this->normalizeModelErrors($model->getErrors()), ]; } return [ 'success' => true, ]; } }