public function actionCreate() { if (Yii::$app->user->can('create-countries')) { $model = new Mtcountries(); if ($model->load(Yii::$app->request->post())) { $model->country_created = $model->country_updated = date('Y-m-d'); $model->country_status = 'ACTIVE'; $model->country_name = strtoupper(strtolower($model->country_name)); $model->save(); Yii::$app->session->setFlash('success', 'Sukses'); return $this->redirect(['index']); //return $this->redirect(['view', 'id' => $model->country_id]); } else { return $this->render('create', ['model' => $model]); } } else { throw new ForbiddenHttpException(); } }