library excel-template
Replace variables in xlsx document
silverslice/excel-template
Replace variables in xlsx document
- Tuesday, November 1, 2016
- by silverslice
- Repository
- 5 Watchers
- 3 Stars
- 330 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 19 % Grown
Why
If you try to create a simple template in PHPExcel, insert some data and save it as a new file,
you will see that conditional formatting is missing. PHPExcel is not a library for editing workbook files:
you're not using PHPExcel to change only one string in a file and save it in the same state., (*1)
Install
composer require silverslice/excel-template
, (*2)
Usage
Place variables in your xlsx-document as {foo}. Then replace them with replace
method., (*3)
use Silverslice\ExcelTemplate\Template;
require __DIR__ . '/vendor/autoload.php';
$template = new Template();
// open file
$template->open('test.xlsx')
// replace one variable to another
->replace('one', 'two')
// replace once more
->replace('foo', 'bar')
// save document
->save('test.xlsx');
dev-master
9999999-dev
Replace variables in xlsx document
Sources
Download
MIT
The Requires
The Development Requires
by
Igor Mikheev
template
excel
xlsx
v0.1.0
0.1.0.0
Replace variables in xlsx document
Sources
Download
MIT
The Requires
The Development Requires
by
Igor Mikheev
template
excel
xlsx