We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcbd345 commit d3b0b3dCopy full SHA for d3b0b3d
src/MultipleInput.php
@@ -10,6 +10,7 @@
10
11
use Yii;
12
use yii\base\Model;
13
+use yii\helpers\ArrayHelper;
14
use yii\widgets\InputWidget;
15
use yii\db\ActiveRecordInterface;
16
use unclead\widgets\renderers\TableRenderer;
@@ -127,7 +128,10 @@ protected function initData()
127
128
}
129
130
if ($this->model instanceof Model) {
- foreach ((array)$this->model->{$this->attribute} as $index => $value) {
131
+ $data = $this->model->hasProperty($this->attribute)
132
+ ? ArrayHelper::getValue($this->model, $this->attribute, [])
133
+ : [];
134
+ foreach ((array) $data as $index => $value) {
135
$this->data[$index] = $value;
136
137
0 commit comments