PHPackages                             shiyingyu/docx-template-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. shiyingyu/docx-template-php

ActiveLibrary[Templating &amp; Views](/categories/templating)

shiyingyu/docx-template-php
===========================

Create Templates in MS Word docx format and use them Creating Business documents using PHP

v0.1.3(6y ago)4193Apache-2.0PHPPHP &gt;=5.3.0

Since Apr 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/shiyingyu/docx-template-php)[ Packagist](https://packagist.org/packages/shiyingyu/docx-template-php)[ Docs](https://github.com/shiyingyu/docx-template-php)[ RSS](/packages/shiyingyu-docx-template-php/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

docxTemplateInPHP
=================

[](#docxtemplateinphp)

Create Templates in MS Word docx format and use them Creating Business documents using PHP

What's New
----------

[](#whats-new)

Changed the namespace of `DocxTemplate` from default to `icircle\Template\Docx`

Introduction
------------

[](#introduction)

This library merges the data in php array into docx file.

The template docx file can be created in MS Word, To specify keys use \[key\] format in MS Word (i.e, specify the array indices inside the square bracket)

### Example

[](#example)

for the data

```
{
    "host":{
        "name":"Host Company",
        "address":"1st Main, 2nd Cross, Bangalore"
    }
}
```

the possible keys are \[host.name\] \[host.address\]

Basic Usage
-----------

[](#basic-usage)

```
use icircle\Template\Docx\DocxTemplate;

$docxTemplate = new DocxTemplate('path/to/template/file');
$dataArray = array() // fill the $dataArray with data
$docxTemplate->merge($dataArray,'path/to/output/file');
```

For More Usage please see the included tests or contact me

###  Health Score

27

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~490 days

Total

4

Last Release

2536d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a1d9a5a6193fbb23cc57d645917ff808b025333ed4aaeef01be45f345c67e963?d=identicon)[shiyingyu](/maintainers/shiyingyu)

---

Top Contributors

[![shiyingyu](https://avatars.githubusercontent.com/u/7370816?v=4)](https://github.com/shiyingyu "shiyingyu (5 commits)")[![Raaghu](https://avatars.githubusercontent.com/u/8255650?v=4)](https://github.com/Raaghu "Raaghu (4 commits)")

---

Tags

doctemplatedocxrtfgridmergetabledocumentmerge list

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shiyingyu-docx-template-php/health.svg)

```
[![Health](https://phpackages.com/badges/shiyingyu-docx-template-php/health.svg)](https://phpackages.com/packages/shiyingyu-docx-template-php)
```

###  Alternatives

[icircle/docx-template-in-php

Create Templates in MS Word docx format and use them Creating Business documents using PHP

4422.7k](/packages/icircle-docx-template-in-php)[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.5k33.5M157](/packages/phpoffice-phpword)[anourvalar/office

Generate documents from existing Excel &amp; Word templates | Export tables to Excel (Grids)

23881.6k](/packages/anourvalar-office)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
