PHPackages                             transfiguration/transfiguration - 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. transfiguration/transfiguration

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

transfiguration/transfiguration
===============================

A light weight templating engine made with php.

1.2.3(8y ago)538MITPHPPHP  ^7.0 || ^7.1 || ^7.2

Since Jan 11Pushed 8y ago2 watchersCompare

[ Source](https://github.com/svichas/Transfiguration)[ Packagist](https://packagist.org/packages/transfiguration/transfiguration)[ RSS](/packages/transfiguration-transfiguration/feed)WikiDiscussions master Synced 2mo ago

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

 [![](transfiguration-logo.png)](transfiguration-logo.png)

##### A light-weight template engine

[](#a-light-weight-template-engine)

[![Travis](https://camo.githubusercontent.com/b81a8858c8cf7d3d4f76e4a1f074144014c36b3440c1329a5d4230f5a1543715/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f737669636861732f5472616e7366696775726174696f6e2e737667)](https://github.com/svichas/Transfiguration) [![GitHub license](https://camo.githubusercontent.com/ed8b437eacb983458d13f09ad0d8b2c7be06619b0b421ac150ac29eb22accd6e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f737669636861732f5472616e7366696775726174696f6e2e737667)](https://github.com/svichas/Transfiguration) [![Packagist](https://camo.githubusercontent.com/c8a6bf1d2a55193ded7d8a5a76bdd0e77b41423388aa38852e96295a96d70317/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5472616e7366696775726174696f6e2f5472616e7366696775726174696f6e2e737667)](https://packagist.org/packages/transfiguration/transfiguration)

### Installation

[](#installation)

PHP versions supported: 7.0, 7.1 and 7.2

---

Install with composer: **(recommended)**

```
composer require transfiguration/transfiguration 1.*

```

```
require 'vendor/autoload.php';
use Transfiguration\Transfiguration;
```

---

Download latest realease: [here](https://github.com/svichas/Transfiguration/releases)

---

### Usage

[](#usage)

```
$transfiguration = new Transfiguration;
// Setting template html
$transfiguration->html($templateHtml);
// Setting template variables
$transfiguration->data($templateData);
// Setting template base path for require and include.
$transfiguration->requirePath($templatePath);
```

### Rendering template

[](#rendering-template)

This function is printing template html into the page.

```
$transfiguration->render();
```

### Exporting template

[](#exporting-template)

This function returns executed template html.

```
$transfiguration->export();
```

### Transfiguration hooks

[](#transfiguration-hooks)

This method extends Transfiguration templating engine functionality.

```
$transfiguration->hook("header", function($content="") {
	return "{$content}";
});

```

usage in Transfiguration code

```
{{ header 'This is a header.'}}
```

---

Transfiguration code
--------------------

[](#transfiguration-code)

### For loop

[](#for-loop)

```

{{ for $key : $value in var }}
	{{ echo $key . " " . $value}}
{{endfor}}

```

### If statement

[](#if-statement)

```
{{ if $loggedin == true}}
	User logged in!
{{ elseif $guest == true }}
	User is guest!
{{ else }}
 	User not logged in!
{{ endif }}
```

### Print &amp; Echo

[](#print--echo)

```
{{echo "string"}}
```

or

```
{{print "string"}}
```

### Including files

[](#including-files)

```
{{ include 'base/footer.html' }}
```

or

```
{{ require 'base/footer.html' }}
```

### Setting variables

[](#setting-variables)

```
{{ var $varname = "varvalue" }}
```

### Comments

[](#comments)

```
{# This is a comment #}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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 ~12 days

Total

4

Last Release

3007d ago

PHP version history (2 changes)1.0.1PHP ^5.3.3 || ^7.0

1.2.2PHP  ^7.0 || ^7.1 || ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7578449618974740b80b9c00af1545d056d0771c11b39c7c57da126eb0db8bda?d=identicon)[svichas](/maintainers/svichas)

---

Top Contributors

[![svichas](https://avatars.githubusercontent.com/u/12978171?v=4)](https://github.com/svichas "svichas (116 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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