data33/phpexcel-wrapper
Composer 安装命令:
composer require data33/phpexcel-wrapper
包简介
A quick and easy wrapper to make excel exports easier
关键字:
README 文档
README
A quick and easy wrapper to make excel exports easier
Example usage
$excel = new Data33\ExcelWrapper\ExcelWrapper(); $excel->setTitle('My first excel file') ->addRow(['Country', 'Capital'], 'header') ->addRow(['Sweden', 'Stockholm']) ->addRow(['Norway', 'Oslo']) ->save('countries.xlsx');
To style specific cells:
$excel->setTitle('My first excel file') ->addRow(['Country', 'Capital'], 'header') ->addRow([['Europe', 'header']]) ->addRow(['Sweden', 'Stockholm']) ->addRow([['Africa', 'header']]) ->addRow(['Tunisia', 'Tunis']) ->save('countries.xlsx');
To add custom styles we can give the wrapper PHPExcel style arrays:
Data33\ExcelWrapper\ExcelStyle::setStyle('red', [ 'font' => [ 'size' => 10, 'name' => 'Arial', 'color' => [ 'rgb' => 'ff0000' ] ] ]); $excel->setTitle('My first excel file') ->addRow(['Country', 'Capital'], 'header') ->addRow(['Sweden', ['Stockholm', 'red']]) ->addRow(['Norway', ['Oslo', 'red']]) ->save('countries.xlsx');
To output directly to browser for download:
$excel->setTitle('My first excel file') ->addRow(['Country', 'Capital'], 'header') ->addRow(['Sweden', 'Stockholm']) ->addRow(['Norway', 'Oslo']) ->outputToBrowser('countries.xlsx');
统计信息
- 总下载量: 763
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-04