Skip to content

Instantly share code, notes, and snippets.

@DeaVenditama
Created December 5, 2019 08:27
Show Gist options
  • Save DeaVenditama/ce30c165aaa8519b4f61f8ab85f529fe to your computer and use it in GitHub Desktop.
Save DeaVenditama/ce30c165aaa8519b4f61f8ab85f529fe to your computer and use it in GitHub Desktop.
Simpeg part 1.action create PegawaiController.php
public function actionCreate()
{
$model = new Pegawai();
if ($model->load(Yii::$app->request->post())) {
$model->created_date = date('Y-m-d H:i:s');
$model->created_by = 0;
$model->save();
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('create', [
'model' => $model,
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment