Skip to content

Commit 96df512

Browse files
committed
Allow attributes in dot notation
1 parent 0c180db commit 96df512

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ActiveExcelSheet.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
namespace codemix\excelexport;
33

4+
use yii\helpers\ArrayHelper;
5+
46
/**
57
* An excel sheet that is rendered with data from an `ActiveQuery`.
68
* A query must be set with `setQuery()`.
@@ -230,7 +232,7 @@ protected function getColumnTypes()
230232
protected function renderRow($data, $row, $formats, $formatters, $callbacks, $types)
231233
{
232234
$values = array_map(function ($attr) use ($data) {
233-
return $data->getAttribute($attr);
235+
return ArrayHelper::getValue($data, $attr);
234236
}, $this->getAttributes());
235237
return parent::renderRow($values, $row, $formats, $formatters, $callbacks, $types);
236238
}

0 commit comments

Comments
 (0)