Password protect

Function Prototype

protection(?string $password = null): self

Example 1

$config = ['path' => './tests'];

$fileObject = new \Vtiful\Kernel\Excel($config);
$fileObject = $fileObject->fileName('tutorial.xlsx');

$filePath = $fileObject->header(['name', 'age'])
    ->data([
        ['viest', 21],
        ['wjx',   21]
    ])
    ->protection() // Enable sheet protection without a password
    ->output();

Example 2

Last updated