コード例 #1
0
 /**
  * Creates a new ClientUsers model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new ClientUsers();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('client-user-form', ['model' => $model]);
     }
 }
コード例 #2
0
 public function actionFbAuth()
 {
     $model = new ClientUsers();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->fbAuth()) {
             return ['auth_key' => $model->auth_key];
         }
     }
     throw new HttpException(400, 'Your credentials are invalid ' . Helper::recursive_implode($model->errors, ',', false, false));
 }