PHPackages                             philipw/yaml-template-generator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. philipw/yaml-template-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

philipw/yaml-template-generator
===============================

1.0.0(7y ago)13GPL-3.0+PHPPHP &gt;7.1

Since Apr 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/philipwhitt/yaml-json-templates)[ Packagist](https://packagist.org/packages/philipw/yaml-template-generator)[ RSS](/packages/philipw-yaml-template-generator/feed)WikiDiscussions master Synced 2w ago

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

[![Build Status](https://camo.githubusercontent.com/1367f1a2568cc6f07dadddc1cb17e1c2ba452b167e28d551482c3666a7184473/68747470733a2f2f7472617669732d63692e6f72672f7068696c697077686974742f79616d6c2d6a736f6e2d74656d706c617465732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/philipwhitt/yaml-json-templates)

YAML/JSON Template Engine
=========================

[](#yamljson-template-engine)

This turns YAML/JSON files into templates that allows the user to pipe in params.

**Example YAML template:**

```
foo: {{ foo }}

```

**Example params file:**

```
{
	"foo" : "bar"
}

```

**Output:**

```
foo: bar

```

**Universal Usage:**

```
docker run -v ${workingdir}:/config \
	-e "TEMPLATEENGINE_TEMPLATEFILE=example/template.yaml" \
	-e "TEMPLATEENGINE_OUTPUTFILE=example/output.yaml" \
	-e "TEMPLATEENGINE_PARAMS=example/params.json" \
	-i philipw/yamltemplates

```

**Bash Function:**Put this bash function in your bash profile and you will be able to generate a templated yaml from anywhere on the CLI

```
function generateYaml() {
	TEMPLATEENGINE_TEMPLATEFILE=$0
	TEMPLATEENGINE_OUTPUTFILE=$1
	TEMPLATEENGINE_PARAMS=$2
	TEMPLATEENGINE_MIXIN=$3
	workingdir=$(pwd)

	docker run -v ${workingdir}:/config \
		-e "TEMPLATEENGINE_TEMPLATEFILE=${TEMPLATEENGINE_TEMPLATEFILE}" \
		-e "TEMPLATEENGINE_OUTPUTFILE=${TEMPLATEENGINE_OUTPUTFILE}" \
		-e "TEMPLATEENGINE_PARAMS=${TEMPLATEENGINE_PARAMS}" \
		-e "TEMPLATEENGINE_MIXIN=${TEMPLATEENGINE_MIXIN}" \
		-i philipw/yamltemplates
}

```

See examples folder for a more complete example.

PHP Lib Usage
=============

[](#php-lib-usage)

Install via composer: `philipw/yaml-template-generator`

```
use TemplateEngine\Config;
use TemplateEngine\Template;

$config = new Config(__DIR__.'/example/params.json');
$template = new Template(
	$config,
	__DIR__.'/example/example.yaml'
);

$template->writeRenderedOutput(__DIR__.'/output.yaml');

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2646d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9290674bc76dcf2516eb568ac6dd972c9cf77e6f1492fc869b491a2740ba95c1?d=identicon)[philipwhitt](/maintainers/philipwhitt)

---

Top Contributors

[![philipwhitt](https://avatars.githubusercontent.com/u/5478888?v=4)](https://github.com/philipwhitt "philipwhitt (6 commits)")

### Embed Badge

![Health badge](/badges/philipw-yaml-template-generator/health.svg)

```
[![Health](https://phpackages.com/badges/philipw-yaml-template-generator/health.svg)](https://phpackages.com/packages/philipw-yaml-template-generator)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49517.1k](/packages/blackfire-player)[altis/local-server

Local Server module for Altis

18217.0k2](/packages/altis-local-server)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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