定制 antsugdev83/simple-xlsx 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

antsugdev83/simple-xlsx

最新稳定版本:1.0.0

Composer 安装命令:

composer require antsugdev83/simple-xlsx

包简介

Simple create file xlsx

README 文档

README

This project have scope simplify use plugin php spreadsheet.

This project create class for management creation file xlsx; into this class it's possible define:

  • plus sheets
  • header difference by number sheets
  • possibility custom font color and background single colunm
  • possibility custom define (if single sheet) define name single sheet
  • possibility added before table, of information additional
  • possibility create, after creation file xlsx, the zip

Use

Into directory example, they are found example code. In general, from user respect this sequence:

  1. instance class
$xlsx = new \Anton\SimpleXlsx\SimpleXlsx($header,'standard',null,1,null,$pathBase,null,null);
  1. instane headers and sheets
 $row  = $xlsx->setSpreadsheet();

This define initial base row.

  1. Read your data and call method for create body:
 $xlsx->setBodyCell(0,0,$row,$item['name'],$color);
  1. Save file
$xlsx->save();

DETAILS OF ARGUMENTS FROM THE INSTANCE CLASS AND FROM THE PRINCIPAL FUNCTION INTO CLASS

INSTANCE

  1. header: array header file; this array it must be how example:
$headeres = [ [] ]
  1. title : name file
  2. sheets: array one-dimensional and value into this it must be string
  3. default row: this define where it begins table. Default is defined to 1; if greater one, table after the row defined
  4. extra data: this can to be string or array; if is defined and defaultRow greater one, into the file xlsx is positioned before table
  5. pathbase: is directory of save file
  6. len: if defined extradata this represents the columns length
  7. extracolor: array, represents the possibility change color font and background

FUNCTION

setSpreadsheet

This function create header and sheets.

The arguments are:

  1. background: you can to be null, if is defined represents color of background the columns from header
  2. color: you can to be null, if is defined represents color of font the columns from header
  3. name sheet: you can to be null, if is defined only sheet and represents name of sheet

setBodyCell

With this function is created column from the body.

The arguments are:

  • index sheet
  • index column (if zero example A0,B0,ec..)
  • row
  • data
  • boolean value: if true define background column difference ('F2F3F4' or 'EAEDED')
  • position text : left,center or rigth
  • number format data: for this argument it is postponed NumberFormat
  • fill: the possibility custom background color column and bold or not bold text; this is an array

save

This function create file. It's possible call this function with argument ZipArchive; if this is defined the function create zip with file xlsx.

EXAMPLE

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-02-11