Open wangdaguo opened 8 years ago
i also got the error: Error when preparing data for import: sheet "Tabelle1", cell "A1". Attribute not exist.
i have an model person with the attributes: _id, forename, surname, birthday and countryid.
my excel looks like this
So whats the problem here?
ok i found the "problem". by default the standardModelsConfig useAttributeLabels is set to true. So i changed this, since i have different labels; and now it works
$importer = new Importer([
'filePath' => Yii::getAlias('@frontend/test.xlsx'),
'standardModelsConfig' => [
[
'className' => Person::className(),
'useAttributeLabels' => false,
],
],
]);
Error when preparing data for import: sheet "data", cell "A1". Attribute not exist.