I think you want to approach something like this. Store values in other models after saving the User model.
public function actionCreate()
{
$model = new User;
$accountsPayable = new AccountsPayable;
$accountsCash = new AccountsCash;
$accountsCheck = new AccountsCheck;
if ($model->load(Yii::$app->request->post()) && $accountsPayable->load(Yii::$app->request->post())
&& $accountsCash->load(Yii::$app->request->post()) && $accountsCheck->load(Yii::$app->request->post())) {
if($model->save()){
//Save user ID in other three models
$accountsPayable->user_id = $model->id;
$accountsCash->user_id = $model->id;
$accountsCheck->user_id = $model->id;
//Store user ID & posted values
$accountsPayable->save();
$accountsCash->save();
$accountsCheck->save();
return $this->redirect(['view', 'id' => $model->id]);
}
} else {
return $this->render('create', [
'model' => $model,
'accountsPayable' => $accountsPayable,
'accountsCash' => $accountsCash,
'accountsCheck' => $accountsCheck,
]);
}
}
So, in your Create form, you can use the variables: $accountsPayable, $accountsCash and $accountsCheck to fill the fields you need for those models in the same form as User