Download the PHP package nowo-tech/word-template-bundle without Composer
On this page you can find all versions of the php package nowo-tech/word-template-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nowo-tech/word-template-bundle
More information about nowo-tech/word-template-bundle
Files in nowo-tech/word-template-bundle
Package word-template-bundle
Short Description Symfony bundle: fill .docx Word templates (PHPWord TemplateProcessor) from a context array — scalars, rich HTML, table rows, images.
License MIT
Homepage https://packagist.org/packages/nowo-tech/word-template-bundle
Informations about the package word-template-bundle
WordTemplateBundle
Found this useful? Install from Packagist (
composer require nowo-tech/word-template-bundle) and consider starring WordTemplateBundle on GitHub.
Symfony bundle that fills Microsoft Word .docx templates (PHPWord TemplateProcessor) using a PHP context array:
- Scalars (strings, numbers, booleans, null) →
setValueon placeholders such as${client_name}or${client.city}when you nest arrays (flattened to dot keys). ConditionalBlock→${#if block}…${#endif block}regions (several sibling and nested blocks supported); show or remove from PHP. Markers split across Word runs are healed before apply.TableRows→cloneRow+ per-cell#1,#2, … replacements for repeating table lines (several independent tables in one.docxvia distinct anchors; oneTableRowsper table row).HtmlContent→ rich fragments (paragraphs, bold/italic, tables inside HTML, etc.) via PHPWordHtml::addHtmlembedded as a complex block (lists<ul>/<ol>may require extra numbering setup in PHPWord; prefer plain paragraphs or combine with HtmlToWordBundle for full HTML pipelines).ImageSource→setImageValuewith optional width/height.listVariables()→ unique paint placeholder names (includes fields inside conditionals; omits#if/#endifmarkers).listConditionalBlocks()→ unique conditional block names (e.g.annexfrom${#if annex}). This bundle does not execute Word VBA macros; “macros” here means template placeholders in the.docxcompatible with PHPWord. Under FrankenPHP (especially worker mode),process()is bounded by a configurabletimeout(default 180s, cooperative deadline +set_time_limit) so a long merge cannot pin a worker forever. See docs/FRANKENPHP-WORKER-AUDIT.md.
This bundle is FrankenPHP worker mode friendly (including kernel-not-reset / scenario B).
Versioning
Quick start
Register Nowo\WordTemplateBundle\WordTemplateBundle if needed, then wire your templates and inject WordTemplateProcessorInterface:
Requirements
- PHP 8.2+
- Symfony 7.x / 8.x (as in
composer.json) - Extensions:
dom,json,libxml,zip
Development
Demos (FrankenPHP)
Demos run with FrankenPHP (Caddy + PHP in Docker). docker-compose defaults to APP_ENV=dev, so the entrypoint uses Caddyfile.dev (no PHP worker), and Twig/PHP changes are visible on refresh. Worker mode applies to a production-style setup — see docs/DEMO-FRANKENPHP.md.
From the repository root:
Or from demo/: make up (see demo/README.md).
Documentation
- GitHub Actions CI requirements
- Installation
- Configuration
- PSR evaluation (REQ-CS-007)
- Usage
- Contributing
- Code of Conduct
- Changelog
- Upgrading
- Release
- Security
- Engram
- Spec-driven development
- GitHub Spec Kit
Additional documentation
demo/README.md)- FrankenPHP worker audit (kernel not reset)
Tests and coverage
| Scope | Detail |
|---|---|
| PHPUnit | composer test — unit + integration (minimal kernel in tests/Fixtures/AppKernel.php). |
| Lines | composer coverage-check enforces ≥ 99% (PCOV). Latest global measurement: ~100%. |
License
MIT License.
All versions of word-template-bundle with dependencies
ext-dom Version *
ext-json Version *
ext-libxml Version *
ext-zip Version *
phpoffice/phpword Version ^1.3
symfony/config Version ^7.0 || ^8.0
symfony/dependency-injection Version ^7.0 || ^8.0
symfony/http-kernel Version ^7.0 || ^8.0