public function actionCreate()
{
$model = new Article();
if ($model->load(Yii::$app->request->post())) {
$model->created=time();
$model->user_id = Yii::$app->user->identity->id;
if($model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
$user->username