Yii2 updating two related models does not show data of the second
问题 I have two related models in hasToMany relation. The first is Invoices and the second is InvoiceItems . As a prototype process, I'm trying to conjugate the two models through the update view of the InvoicesController using the following code in actionUpdate of InvoicesController : ... use common\models\Invoices; use common\models\InvoicesSearch; use common\models\InvoiceItems; ... public function actionUpdate($id) { $model = $this->findModel($id); $invoiceItems = new InvoiceItems(); if (