Skip to content

Commit

Permalink
PhpOffice 导出时调用 $callbackData 回调函数处理数据
Browse files Browse the repository at this point in the history
  • Loading branch information
isssun committed Jul 22, 2024
1 parent 7a41445 commit 64afe93
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Excel/PhpOffice.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ public function export(string $filename, array|\Closure $closure, ?\Closure $cal
while ($generate->valid()) {
$column = 0;
$items = $generate->current();
if ($callbackData) {
$items = $callbackData($items);
}
foreach ($items as $name => $value) {
$columnRow = $this->getColumnIndex($column) . $row;
$annotation = '';
Expand Down

0 comments on commit 64afe93

Please sign in to comment.