Ejemplo n.º 1
0
 /**
  * Creates a new Kabupaten model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Kabupaten();
     if (Yii::$app->request->isPost) {
         $model->load(Yii::$app->request->post());
         $model->autoNumber();
         if ($model->validate() && $model->save()) {
             Yii::$app->getSession()->setFlash('success', Yii::t('app', 'Your data kabupaten has been successfully saved'));
             return $this->redirect(['create']);
         } else {
             Yii::$app->getSession()->setFlash('error', Yii::t('app', 'Your data kabupaten failed to save'));
         }
     }
     return $this->render('create', ['model' => $model]);
 }