定义名称
函数原型
defineName(string $name, string $formula, ?string $scopeSheet = null): selfstring $name
string $formula
string $scopeSheet
示例
Last updated
$config = [
'path' => './tests'
];
$fileObject = new \Vtiful\Kernel\Excel($config);
$fileObject = $fileObject->fileName('tutorial.xlsx', 'Sheet1');
$filePath = $fileObject->header(['name', 'amount'])
->data([
['viest', 1000],
['wjx', 2000],
])
->defineName('SalesTotal', '=Sheet1!$B$2') // 全局名称
->defineName('LocalRange', '=Sheet1!$B$2:$B$3', 'Sheet1') // 局部名称(仅 Sheet1 可见)
->output();