PHPackages                             piestar/dough - 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. piestar/dough

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

piestar/dough
=============

The Dough Templating Language

1.0.1(7y ago)18.7k↓33.3%MITPHP

Since Aug 5Pushed 7y ago2 watchersCompare

[ Source](https://github.com/Piestar/dough)[ Packagist](https://packagist.org/packages/piestar/dough)[ RSS](/packages/piestar-dough/feed)WikiDiscussions master Synced 1mo ago

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

Dough Template Language
=======================

[](#dough-template-language)

[![Build Status](https://camo.githubusercontent.com/9dbb37ce7773e072d854abb1c5545388c05de08a837a73a201f217a5506a6968/68747470733a2f2f7472617669732d63692e6f72672f506965737461722f646f7567682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Piestar/dough)[![Total Downloads](https://camo.githubusercontent.com/05c07b06a89bc4bd23b7633b035cbe3f003bcd5507b32fb90033891da0c65cb3/68747470733a2f2f706f7365722e707567782e6f72672f506965737461722f646f7567682f642f746f74616c2e737667)](https://packagist.org/packages/Piestar/dough)[![Latest Version](https://camo.githubusercontent.com/5b7063b948f4d05e73342b46a45d097c8933bc90970721d4a3e5361c7aa6aa9c/68747470733a2f2f706f7365722e707567782e6f72672f506965737461722f646f7567682f762f737461626c652e737667)](https://packagist.org/packages/Piestar/dough)[![License](https://camo.githubusercontent.com/320001f6f3ad665a6631c1ca4a543a57798c7417158a24601553b465cceaee6e/68747470733a2f2f706f7365722e707567782e6f72672f506965737461722f646f7567682f6c6963656e73652e737667)](https://packagist.org/packages/Piestar/dough)

Dough is a tiny templating language that understands two constructs:

- `{{ some_variable }}` Normal variables (will be HTML-escaped on output)
- `{!! some_variable !!}` Raw variables (will not be HTML-escaped when output)

It also allows for arrays in its data: `{{ pie.name }}`

We use this for user-exposed tokens in a mail merge, where we wouldn't want the user to have access to a more complex templating language with a larger surface area to secure.

Be aware that this package does not currently protect against JavaScript or malicious HTML injection.

Examples
--------

[](#examples)

```
$mixed = DoughMixer::mix("pie is {{ pie }}"   , ['pie' => '']); // "pie is &lt;good&rt;"
$mixed = DoughMixer::mix("pie is {!! pie !!}" , ['pie' => '']); // "pie is "
$mixed = DoughMixer::mix("Eat {{ pie.name }}!",
                                 ['pie' => ['name' => 'Apple Pie']]); // "Eat Apple Pie!"
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~1233 days

Total

2

Last Release

2706d ago

### Community

Maintainers

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

---

Top Contributors

[![claar](https://avatars.githubusercontent.com/u/402855?v=4)](https://github.com/claar "claar (5 commits)")

---

Tags

phptemplatedoughtemplating language

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/piestar-dough/health.svg)

```
[![Health](https://phpackages.com/badges/piestar-dough/health.svg)](https://phpackages.com/packages/piestar-dough)
```

###  Alternatives

[alhimik1986/php-excel-templator

PHP Spreadsheet extension for generating excel files from template

350336.7k1](/packages/alhimik1986-php-excel-templator)

PHPackages © 2026

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