Ejemplo n.º 1
0
 /**
  * Creates a new Admin model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Admin();
     if ($model->load(Yii::$app->request->post()) && $model->setPassword($model->new_password) && $model->save(true, array('id', 'name', 'username', 'email', 'password_hash', 'english_name', 'role', 'status', 'created_at', 'updated_at'))) {
         return $this->redirect(['user/index']);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }