\addons\dataoutput\libraryExcel

导出导入Excel

Class Excel

Summary

Methods
Properties
Constants
__construct()
exportData()
getHeader()
buildSql()
$fields
$config
No constants found
formatting()
strToArr()
formattingField()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$fields

$fields

$config

$config

Methods

__construct()

__construct(mixed  $config) : mixed

Parameters

mixed $config

Returns

mixed —

exportData()

exportData(string  $filename = '', string  $path = '', string  $image = []) : bool

导出Excel

Parameters

string $filename

导出的文件名

string $path

导出的存放地址 无则不在服务器存放

string $image

导出的格式 可以用 大写字母 或者 数字 标识 哪一列

Throws

\PhpOffice\PhpSpreadsheet\Exception
\PhpOffice\PhpSpreadsheet\Writer\Exception

Returns

bool —

getHeader()

getHeader() : mixed

Returns

mixed —

buildSql()

buildSql() : mixed

Returns

mixed —

formatting()

formatting(array  $array, mixed  $value, mixed  $row) : false|mixed|null|string

格式化内容

Parameters

array $array

头部规则

mixed $value
mixed $row

Returns

false|mixed|null|string —

内容值

strToArr()

strToArr(mixed  $str, mixed  $val) : mixed

Parameters

mixed $str
mixed $val

Returns

mixed —

formattingField()

formattingField( $row,  $field) : mixed

解析字段

Parameters

$row
$field

Returns

mixed —