2017 © Pedro Peláez
 

library yii2-phpspreadsheet

Yii2处理Excel文件, 修改自moonlandsoft/yii2-phpexcel。

image

sunmoon/yii2-phpspreadsheet

Yii2处理Excel文件, 修改自moonlandsoft/yii2-phpexcel。

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 450 % Grown

The README.md

说明

Yii2 处理 Excel 文件, 修改自moonlandsoft/yii2-phpexcel。, (*1)

修改项:, (*2)

1. 由于phpoffice/phpexcel已经弃用,更新为phpoffice/phpspreadsheet
2. 导出文件后退出脚本导致程序后续代码无法执行的问题
3. 增加按行读取excel的功能 1.0.8
4. 提供获取文件总行的的功能 1.0.8
5. 修复 BUG : 分页导入数据时,读取第二页时,无法获取第一行的数据作为数组的键值
6. 增加配置项 storeFile ,作为临时储存第一行的数据作为键值,默认为null
7. 增加配置项 dropKeysRow true/false,读取第一页的数据时,是否作为数组键值的行从数组中丢弃,默认为false
8. 增加验证功能,readEndRow不能小于readStartRow

安装

  1. 安装包文件, (*3)

    bash $ composer require sunmoon/yii2-phpspreadsheet '*', (*4)

使用

  1. 代码中使用参见 moonlandsoft/yii2-phpexcel, (*5)

  2. 如何按行读取excel, (*6)

use sunmoon\phpspreadsheet\Excel as ExcelHelper;
public function actionReadExcel(){
    $fileName = 'demo.xlsx';
    //从第1行读取到第7行
    $data = ExcelHelper::import($fileName, ['readStartRow'=>1, 'readEndRow'=>7, ]);
    return $data;
}
  1. 如何按行读取excel的总行数
use sunmoon\phpspreadsheet\Excel as ExcelHelper;
public function actionReadExcelRows(){
    $fileName = 'demo.xlsx';
    $data = ExcelHelper::getHighestRows($fileName);
    return $data;
}

其他

  1. 从phpexcel迁移到phpspreadsheet的注意事项,migration-from-PHPExcel

License

The MIT License (MIT). Please see License File for more information., (*7)

The Versions

17/05 2018

v1.0.3

1.0.3.0 https://github.com/arieslee/yii2-phpspreadsheet

Yii2处理Excel文件, 修改自moonlandsoft/yii2-phpexcel。

  Sources   Download

MIT

The Requires

 

17/05 2018

dev-master

9999999-dev https://github.com/arieslee/yii2-phpspreadsheet

Yii2处理Excel文件, 修改自moonlandsoft/yii2-phpexcel。

  Sources   Download

MIT

The Requires

 

27/04 2018

1.0.2

1.0.2.0 https://github.com/arieslee/yii2-phpspreadsheet

Yii2处理Excel文件, 修改自moonlandsoft/yii2-phpexcel。

  Sources   Download

MIT

The Requires

 

27/04 2018

1.0.1

1.0.1.0 https://github.com/arieslee/yii2-phpspreadsheet

Yii2处理Excel文件, 修改自moonlandsoft/yii2-phpexcel。

  Sources   Download

MIT

The Requires

 

27/04 2018

1.0

1.0.0.0 https://github.com/arieslee/yii2-phpspreadsheet

Yii2处理Excel文件, 修改自moonlandsoft/yii2-phpexcel。

  Sources   Download

MIT

The Requires