Custom properties
Function Prototype
setCustomProperty(string $name, mixed $value, ?string $type = null): selfstring $name
mixed $value
string $type
Example
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') // inferred as string
->setCustomProperty('Confidential', true) // inferred as boolean
->setCustomProperty('Revision', 3) // inferred as number
->setCustomProperty('Reviewed', time(), 'datetime') // datetime must be explicit
->output();