Пример #1
0
 /**
  * Creates a new ApiUser model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new ApiUser();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Пример #2
0
 /**
  * Creates a new ApiUser model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new ApiUser();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         $render = (new SignLogic())->signIn($model->UserName, $model->Password);
         return $this->render('in', ['render' => $render]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
Пример #3
0
 /**
  * Creates a new ApiUser model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionUp()
 {
     $this->layout = '@app/views/sign/layouts/sign';
     $model = new ApiUser();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         SmsHelper::sendRegSuccess($model->Phone, $model->UserName, $model->Password);
         return $this->render('in', ['username' => $model->UserName, 'password' => $model->Password, 'mobile' => $model->Phone]);
     } else {
         return $this->render('up', ['model' => $model]);
     }
 }