bingo-soft / phpdocxtemplate
PHP library which uses docx files as Twig templates
Installs: 5 060
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 4
Open Issues: 0
Type:project
Requires
- php: ^7.4
- ext-dom: *
- ext-zip: *
- endroid/qr-code: ^4.4
- twig/twig: ^3.3
Requires (Dev)
README
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