it-poet / excel-keys-replacer
A package to replace special labels in Excel files matching array keys.
0.0.1
2017-03-31 03:46 UTC
Requires
- phpoffice/phpexcel: 1.8.*
This package is not auto-updated.
Last update: 2025-02-07 20:53:17 UTC
README
Use Excel files as templates. This package will replace special labels in Excel files (both xls and xlsx) matching array keys.
Required: phpoffice/phpexcel.
Install via composer:
composer require it-poet/excel-keys-replacer
Example:
Insert anywhere in xls_keys.xls in any cells and .
$excel = new \ItPoet\ExcelKeysReplacer\Replacer; $excel->file('path/to/file/xls_keys.xls'); $excel->data([ 'key1' => 'some text', 'key2' => '12345', ]); $xls = $excel->replace(); $writer = new \PHPExcel_Writer_Excel5($xls); $writer->save('path/to/file/xls_replaced.xls');
Optionally (with default values):
$excel->keyWrapper('${', '}$'); $excel->sheet(0);
TODO:
- multi-row insert to build tables (if key is array).