xlsx-template-php
A library for templating of Excel Office documents. Supports MS Excel xlsx. Uses PhpSpreadsheet library., (*1)
Not only large documents., (*2)
An example
, (*3)
Some code
``` php
$templator = new Templator($templateFile, $outputDir, 'document.xlsx');, (*4)
$settings = new Settings([
'providerName' => 'ИП Сумкин Ф.Ф.',
'clientName' => 'ООО "Рога и копыта"',
'docNumber' => 5485,
'docDate' => date('d.m.Y'),
'totalProductAmount' => 4,
'totalProductSum' => 2000,
]);, (*5)
$loopData = new LoopData();
$loopData->setMap([
'productName',
'productArticle',
'productUnit',
'productAmount',
'productPrice',
'productSum',
]);
$loopData->setSource([
['Стол письменный', 'СП-234', 'шт.', 1, 1500, 1500],
['Чернильница', '75332', 'шт.', 2, 200, 400],
['Лампа настольная 12Вт', '6454', 'шт.', 1, 100, 100],
]);
$settings->addLoop(1, $loopData);, (*6)
$templator->render($settings);
$templator->save();
```, (*7)
Output document
, (*8)