承接 data33/phpexcel-wrapper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-04