自定义属性
函数原型
setCustomProperty(string $name, mixed $value, ?string $type = null): selfstring $name
mixed $value
string $type
示例
Last updated
$config = [
'path' => './tests'
];
$fileObject = new \Vtiful\Kernel\Excel($config);
$fileObject = $fileObject->fileName('tutorial.xlsx');
$filePath = $fileObject->header(['name', 'age'])
->data([
['viest', 21],
['wjx', 21]
])
->setCustomProperty('Department', 'Sales') // 自动按 string 处理
->setCustomProperty('Confidential', true) // 自动按 boolean 处理
->setCustomProperty('Revision', 3) // 自动按 number 处理
->setCustomProperty('Reviewed', time(), 'datetime') // datetime 必须显式指定
->output();