boenrobot/big-xlsx-bundle
最新稳定版本:v1.0.1
Composer 安装命令:
composer require boenrobot/big-xlsx-bundle
包简介
Symfony2 Bundle for generating large multi-sheeted xlsx files with low memory usage. Fork of bassim/BigXlsxBundle, for compatibility with newer PHP versions.
关键字:
README 文档
README
Symfony2 Bundle for generating large multi-sheeted xlsx files with low memory usage.
This Bundle basically acts as a replacement for creating csv files with large datasets. This, because the CSV format can be troublesome when it comes to difference in default cell separators en line-endings on specific operating systems. Also, obviously, CSV cannot handle multiple sheets.
This bundle uses the 'codeplex/phpexcel' bundle but tries to get rid of the enormous execution time and memory consumption when one wants to store large datasets in a xlsx.
Installation
add this to your composer.json:
"bassim/big-xlsx-bundle": "dev-master"
add this to your AppKernel.php
new Bassim\BigXlsxBundle\BassimBigXlsxBundle(),
Basic Usage
/** @var $service BigXlsxService */
$service = $container->get('bassim_big_xlsx.service');
$data[] = array("id","name");
for ($i=0;$i<1;$i++) {
$data[] = array($i, "name_".$i);
}
$service->addSheet(0, "test Sheet_0", $data);
$file = $service->getFile();
Adding a custom sheet
/** @var $service BigXlsxService */
$service = $container->get('bassim_big_xlsx.service');
$data[] = array("id","name");
for ($i=0;$i<1;$i++) {
$data[] = array($i, "name_".$i);
}
$service->addSheet(0, "test Sheet_0", $data);
$objPHPExcel = $service->getPHPExcel();
//add custom sheet
$objPHPExcel->createSheet(1);
$objPHPExcel->setActiveSheetIndex(1);
$objPHPExcel->getActiveSheet()->setTitle("test");
// ....
$file = $service->getFile();
统计信息
- 总下载量: 7.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-16