stolentine / excel
此包的最新版本(v1.0.0)没有提供许可证信息。
v1.0.0
2021-07-07 08:29 UTC
Requires
- maatwebsite/excel: ^3.1
This package is auto-updated.
Last update: 2022-10-07 12:40:47 UTC
README
一个用于处理 EXCEL 文件的包装层。
允许抽象具体库的实现。
创建导出示例。
use Stolentine\Excel\Export\IExcelExport; use Stolentine\Excel\Table; class ExportController extends \Illuminate\Routing\Controller { public function export(IExcelExport $excelExport){ // любые данные $data = [ ['foo0', 'baz0', 'bar0'], ['foo1', 'baz1', 'bar1'], ['foo2', 'baz2', 'bar2'], ]; // заголовки колонок $headings = [ 'FooHeader', 'BazHeader', 'BarHeader', ]; // скачивание файла. В конце файл удалится. return $excelExport->setTable( new Table($data, $headings) )->setFileName('examplName.csv'); } }
文件内容
"FooHeader","BazHeader","BarHeader"
"foo0","baz0","bar0"
"foo1","baz1","bar1"
"foo2","baz2","bar2"
####待办事项
- 添加返回值的类型
- 将文件保存在文件系统中
- 设置标题