PHPackages                             piotrpress/templater - 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. piotrpress/templater

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

piotrpress/templater
====================

This library is a simple template engine file loader with variable support.

v1.2.0(1y ago)11923GPL-3.0PHPPHP &gt;=7.4

Since Mar 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/PiotrPress/templater)[ Packagist](https://packagist.org/packages/piotrpress/templater)[ Docs](https://piotr.press)[ RSS](/packages/piotrpress-templater/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (4)Used By (3)

Templater
=========

[](#templater)

This library is a simple template engine file loader with variable support.

Installation
------------

[](#installation)

```
composer require piotrpress/templater
```

Usage
-----

[](#usage)

```
require __DIR__ . '/vendor/autoload.php';

use PiotrPress\Templater;
use PiotrPress\Templater\Template;

$templater = new Templater( __DIR__ . '/templates' );

// Example #1
$templater->display( 'template', [
    'var1' => 'value1',
    'var2' => 'value2'
] );

// Example #2
echo $templater->render( 'template', [
    'var1' => 'value1',
    'var2' => 'value2'
] );

// Example #3
echo new Template( __DIR__ . '/templates/template.php', [
    'var1' => 'value1',
    'var2' => 'value2'
] );
```

**Note:** All Errors in templates will be converted to Exceptions.

License
-------

[](#license)

[GPL3.0](license.txt)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

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

Every ~636 days

Total

3

Last Release

609d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10326736?v=4)[Piotr Niewiadomski](/maintainers/PiotrPress)[@PiotrPress](https://github.com/PiotrPress)

---

Top Contributors

[![PiotrPress](https://avatars.githubusercontent.com/u/10326736?v=4)](https://github.com/PiotrPress "PiotrPress (3 commits)")

---

Tags

displayphpphp-template-enginerendertemplatetemplate-enginetemplatertemplatesphptemplatetemplatestemplate enginerenderdisplaytemplaterphp template engine

### Embed Badge

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

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

###  Alternatives

[alhimik1986/php-excel-templator

PHP Spreadsheet extension for generating excel files from template

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

Pug (ex-Jade) facade engine for PHP, HTML template engine structured by indentation

67292.2k13](/packages/phug-phug)[talesoft/tale-pug

A clean, lightweight and easy-to-use templating engine for PHP based on Pug, formerly Jade

319.4k3](/packages/talesoft-tale-pug)[talesoft/tale-jade

A clean, lightweight and easy-to-use templating engine for PHP based on Jade/Pug

8919.3k5](/packages/talesoft-tale-jade)

PHPackages © 2026

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