it-poet / excel-keys-replacer
A package to replace special labels in Excel files matching array keys.
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/it-poet/excel-keys-replacer
Requires
- phpoffice/phpexcel: 1.8.*
This package is not auto-updated.
Last update: 2025-11-01 00:30:09 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 ${key1}$ and ${key2}$.
$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).