bingo-soft/phpdocxtemplate

PHP library which uses docx files as Twig templates

v1.6.0 2022-12-28 07:55 UTC

README

Latest Stable Version Build Status Minimum PHP Version License: MIT Scrutinizer Code Quality Code Coverage

PhpDocxTemplate

PhpDocxTemplate is a PHP library, which uses docx files as Twig templates

Installation

Install PhpDocxTemplate, using Composer:

composer require bingo-soft/phpdocxtemplate

Basic example

use PhpDocxTemplate\PhpDocxTemplate;

$doc = "./templates/template1.docx";
$template = new PhpDocxTemplate($doc);
$template->render(["one" => "1", "two" => "2", "three" => "3", "four" => "4"]);
$template->save("./documents/report.docx");

Acknowledgements

PhpDocxTemplate draws inspiration from python-docx-template and PhpWord libraries.

License

MIT