public function actionCreate()
{
$model = new Schedule();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
$model->created_by = Yii::$app->user->identity->username;
$model->created_date = date("Y-m-d H:i:s");
$model->save();
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('create', [
'model' => $model,
]);
}