public function actionCreate()
{
$post = new Post();
$postInfo = new PostInfo();
if ( $post->load(Yii::$app->request->post()) && $postInfo->load(Yii::$app->request->post()) && $post->save() ) {
$post->link('postInfo', $postInfo);
$post->save();
return $this->redirect(['view', 'id' => $post->post_id]);
} else {
return $this->render('create', [
'model' => $post,
'postInfo' => $postInfo,
'uploadModel' => $uploadModel
]);
}
}