Revision #24 has been created by rackycz on Sep 8, 2020, 8:00:56 PM with the memo:
Composer and PhpExcel
« previous (#23) next (#25) »
Changes
Title
unchanged
Yii v2 snippet guide II
Category
unchanged
Tutorials
Yii version
unchanged
2.0
Tags
unchanged
tutorial,beginner,yii2,snippets
Content
changed
[...]
header('Cache-Control: max-age=0');
$writer->save('php://output');
exit();
```
Thanks to [DbCreator](https://forum.yiiframework.com/t/yii2-phpoffice-phpspreadsheet-src-phpspreadsheet-shared-ole-pps-root-php-on-line-292-headers-already-sent/126617) for the latter approach. But exit() or die() should not be called. Read the link.
Following is my idea which originates from method renderPhpFile() from Yii2:[...]
exit();
```
Note: But exit() or die() should not be called. Read the "DbCreator" link above.