The use of Multiple Input, how to update?

Good afternoon. Me a lot of questions, but nothing can be done (
There are several models, filling in one form - which can have multiple addresses, phone numbers and to which must be attached to registration documents.

The Create method everything is fine, everything is filled in, everything is fine, everything is saved
5cf3c26798f9f424659479.png
public function actionCreate() {
 $model = new Organization(); 
 $modelOrganizationAddress = new OrganizationAddress();
 $modelOrganizationPhone = new OrganizationPhone();
 $license = new UploadLicenseForm();


 if ($model->load(Yii::$app->request->post()) &&
 $modelOrganizationAddress->load(Yii::$app->request->post()) &&
 $modelOrganizationPhone->load(Yii::$app->request->post()) &&
 $license->load(Yii::$app->request->post()) &&
 $model->save()) { 
 $modelOrganizationAddress->organization_id = $model->id;
 $modelOrganizationPhone->organization_id = $model->id;

$this->saveAddress($modelOrganizationAddress);
$this->savePhone($modelOrganizationPhone);
 $license->licenseFiles = UploadedFile::getInstances($license, 'licenseFiles');
 if ($license->upload($modelOrganizationLang)) {
 Yii::$app->session->setFlash('success', "Organization saved");
}

 return $this->redirect(['view', 'id' => $model->id]);
}

 return $this->render('create', [
 'model' => $model,
 'modelOrganizationAddress' => $modelOrganizationAddress,
 'modelOrganizationPhone' => $modelOrganizationPhone,
 'license' => $license
]);
 }

I would like to be able to edit it with the help of actionUpdate:
public function actionUpdate($id) {
 $model = $this->findModel($id);
 $modelOrganizationAddress = OrganizationAddress::find()->where(['organization_id' => $id])->all();
 $modelOrganizationPhone = OrganizationPhone::find()->where(['organization_id' => $id])->all();

 $license->scenario = 'update-photo-upload';
 if ($model->load(Yii::$app->request->post()) &&
 $modelOrganizationAddress->load(Yii::$app->request->post()) &&
 $modelOrganizationPhone->load(Yii::$app->request->post()) &&
 $model->save()) {
// $license->licenseFiles = UploadedFile::getInstances($license, 'licenseFiles');
 $modelOrganizationAddress->organization_id = $model->id;
 $modelOrganizationPhone->organization_id = $model->id;



$this->saveAddress($modelOrganizationAddress);
$this->savePhone($modelOrganizationPhone);
 $license->imageFiles = UploadedFile::getInstances($model, 'imageFiles');
 if ($license->upload()) {
 Yii::$app->session->setFlash('success', "Organization updated");

}
 return $this->redirect(['view', 'id' => $model->id]);
 }

All this is in my form with Multiple Input:
<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
 <?= $form->errorSummary($model); ?>
<?=
 $form->field($model, 'status')->dropDownList([
 '0' => 'Disabled',
 '1' => 'Active',
]);
?>
 <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>

 <?= $form->field($model, 'full_name')->textInput(['maxlength' => true]) ?>



<?php
 echo $form->field($modelOrganizationAddress, 'address')->label(HModule::t('organization', 'Address'))->widget(MultipleInput::className(), [
 'max' => 4,
 'columns' => [
[
 'name' => 'country',
 'title' => HModule::t('organization', 'Country'),
 'options' => [
 'class' => 'input-priority'
],
],
[
 'name' => 'city',
 'title' => HModule::t('organization', 'City'),
 'options' => [
 'class' => 'input-priority'
],

],
[
 'name' => 'street',
 'title' => HModule::t('organization', 'Street'),
 'options' => [
 'class' => 'input-priority'
]
],
[
 'name' => 'building',
 'title' => HModule::t('organization', 'Building'),
 'options' => [
 'class' => 'input-priority'
]
],
[
 'name' => 'zip_code',
 'title' => HModule::t('organization', 'Zip Code'),
 'options' => [
 'class' => 'input-priority'
]
]
]
]);
?>
...
 <?php echo $form->field($license, 'licenseFiles[]')->fileInput(['multiple' => true, 'accept' => 'image/*']) ?>

Question - how does zapolnenie update with multiple fields (multiple)?
I need to pass the _form all addresses owned by the organization:
Страна1, Улица2
Страна2, Улица2
...
But how to do it, because the field that one?)
echo $form->field($modelOrganizationAddress, 'address')->label(HModule::t('organization', 'Address'))->widget(MultipleInput::className(), [
 'max' => 4,
 'columns' => [
[
 'name' => 'country',
 'title' => HModule::t('organization', 'Country'),
 'options' => [
 'class' => 'input-priority'
],

],
[
 'name' => 'city',
 'title' => HModule::t('organization', 'City'),
 'options' => [
 'class' => 'input-priority'
],

],
...
[
 'name' => 'zip_code',
 'title' => HModule::t('organization', 'Zip Code'),
 'options' => [
 'class' => 'input-priority'
]
]
]
 ]);

As it is necessary to pass the array $items in Wattpad?
I confess that maybe this is in the documentation , but I don't quite understand how "hits" in the form of pre-filled values:
Call to a member function formName() on the array, so I get Yes, an array of objects
PS I Hope that toaster is not banyat for the duplication of questions on different resources
March 23rd 20 at 18:45
0 answer

Find more questions by tags Yii