PHPackages                             varm3r/tmpl - 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. varm3r/tmpl

ActiveLibrary

varm3r/tmpl
===========

A simple template engine

01PHP

Since Mar 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/varm3r/tmpl)[ Packagist](https://packagist.org/packages/varm3r/tmpl)[ RSS](/packages/varm3r-tmpl/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

About
-----

[](#about)

This is a simple template engine. It support simple variables and if-else conditions.

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

[](#installation)

```
composer require varm3r/tmpl

```

How to Use
----------

[](#how-to-use)

To create template by text:

```
try {
    // variables
    $text = '{title}';
    $tmpl = \Tmpl\Factory::createByText($text);
    echo $tmpl->render(['title' => 'my header']); // it will output "my header"
    echo $tmpl->render(['title' => 'subtitle']); // it will output "subtitle"

    // if-conditions
    $text = '{if userName}Hello {userName}!{/if}';
    $tmpl = \Tmpl\Factory::createByText($text);
    echo $tmpl->render(['userName' => 'Adam']); // it will output "Hello Adam!"

    // nested if-else conditions
    $text = true, 'test2' => false]); // it will output "white cat"
    echo $tmpl->render(['test1' => false, 'test2' => true]); // it will output "gray wolf"

} catch (\Tmpl\Exception\Exception $e) {
    // an exception will be thrown if template has error
}
```

It is posible to create template by filepath:

```
try {
    $filepath = '/path/to/file.tpl';
    $tmpl = \Tmpl\Factory::create($filepath);
    echo $tmpl->render(['title' => 'excelent!']);
} catch (\Tmpl\Exception\Exception $e) {
    // an exception will be thrown if file does not exists or cannot be read
}
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/07fc43a63c47b062deb66f08849a47074f52dd67a63d68d5ba1246a75c56c991?d=identicon)[varm3r](/maintainers/varm3r)

### Embed Badge

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

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

PHPackages © 2026

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