Created
December 5, 2019 08:27
-
-
Save DeaVenditama/ce30c165aaa8519b4f61f8ab85f529fe to your computer and use it in GitHub Desktop.
Simpeg part 1.action create PegawaiController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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