Esempio n. 1
0
 /**
  * Creates a new User model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new User();
     $model->setScenario('backendCreate');
     if ($model->load($_POST)) {
         $model->setDateAttribute('date_of_birth', $model->date_of_birth);
         if ($model->save()) {
             return $this->redirect(['view', 'id' => $model->id]);
         }
     }
     return $this->render('create', ['model' => $model]);
 }