代码仓库:https://github.com/PHPOffice/PhpSpreadsheet


1、进入/dayrui目录

2、使用命令行安装类

也可以使用迅睿的第三方类仓库:https://gitee.com/dayrui/composer,将下载的文件放到dayrui/Vendor/目录中。

3、需要将vendor目录命名为Vendor(首字母大写)

4、新建控制器文件 :

dayrui/App/Demo/Controllers/Excel.php


5、访问url,即可下载excel文件

index.php?s=demo&c=excel&m=index

image



具体参数配置参考PhpOffice官方的文档介绍

https://phpspreadsheet.readthedocs.io/


本文地址:https://m.xunruicms.com/doc/1026.html