PHPackages                             laemmi/simple-template-engine - 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. laemmi/simple-template-engine

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

laemmi/simple-template-engine
=============================

This is very simple template engine to parse templates

v1.1.1(2y ago)097MITPHPPHP ^8.1

Since Jul 10Pushed 2y agoCompare

[ Source](https://github.com/Laemmi/simple-template-engine)[ Packagist](https://packagist.org/packages/laemmi/simple-template-engine)[ Docs](https://github.com/laemmi/simple-template-engine)[ RSS](/packages/laemmi-simple-template-engine/feed)WikiDiscussions master Synced 2mo ago

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

[![Build Status](https://camo.githubusercontent.com/c959ac3c7f6fb848ac639f7a23ffb4a553a37870e26e6c004a15cce48889be3f/68747470733a2f2f7472617669732d63692e6f72672f4c61656d6d692f73696d706c652d74656d706c6174652d656e67696e652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Laemmi/simple-template-engine)[![Latest Stable Version](https://camo.githubusercontent.com/21578e7613953db77dd593d50e047b6c45485d3fd6982a515c7aed3f56e6c0d4/68747470733a2f2f706f7365722e707567782e6f72672f6c61656d6d692f73696d706c652d74656d706c6174652d656e67696e652f762f737461626c65)](https://packagist.org/packages/laemmi/simple-template-engine)[![Total Downloads](https://camo.githubusercontent.com/d008e9eba235b7d5debda63a37b217d3cc8840d34532dc6fe44eb1a5cd11cd17/68747470733a2f2f706f7365722e707567782e6f72672f6c61656d6d692f73696d706c652d74656d706c6174652d656e67696e652f646f776e6c6f616473)](https://packagist.org/packages/laemmi/simple-template-engine)[![Latest Unstable Version](https://camo.githubusercontent.com/8f3d66c8ada5a6c8816352420bba468452d72b40bc30c9433da1b07f5a9f9bc3/68747470733a2f2f706f7365722e707567782e6f72672f6c61656d6d692f73696d706c652d74656d706c6174652d656e67696e652f762f756e737461626c65)](https://packagist.org/packages/laemmi/simple-template-engine)[![License](https://camo.githubusercontent.com/75cbc32ea41cd3f2668f1b7a8c66c38d82b8f3c8adac7a1d606b3e98fcfa6006/68747470733a2f2f706f7365722e707567782e6f72672f6c61656d6d692f73696d706c652d74656d706c6174652d656e67696e652f6c6963656e7365)](https://packagist.org/packages/laemmi/simple-template-engine)

Simple template engine
======================

[](#simple-template-engine)

This is very simple template engine to parse templates.

Requirements
------------

[](#requirements)

php 7.2

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

[](#installation)

via composer

```
composer require laemmi/simple-template-engine

```

or use repository

```
git clone https://github.com/Laemmi/simple-template-engine.git

```

Usage
-----

[](#usage)

In this package you have to compiler. Once for replacing variable and one for if statements. For the variable compiler you can use modifiers. In default you can use all php functions like strtoupper etc.

### Use with factory

[](#use-with-factory)

```
$template = TemplateFactory::factory('My name is {if $name}{#name|strtoupper#}{/if} and i am {#age#} years old.');
$template->name = 'Michael';
$template->age  = 99;
$template();

// My name is MICHAEL and i am 99 years old.

```

### Use with callback modifier

[](#use-with-callback-modifier)

```
$callback = new ModifierCallback('custom', function($value) {
    return sprintf('Sir %s', $value);
});

$compiler = new CompileVariable();
$compiler->addModifier($callback);

$template = new Template('My name is {#name|custom#}');
$template->addPlugin($compiler);
$template->name = 'Michael';
$template();

// My name is Sir Michael

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity71

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

Total

5

Last Release

940d ago

PHP version history (2 changes)v1.0.0PHP ^7.2

v1.1.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![Laemmi](https://avatars.githubusercontent.com/u/2380862?v=4)](https://github.com/Laemmi "Laemmi (7 commits)")

---

Tags

templatetemplate engine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laemmi-simple-template-engine/health.svg)

```
[![Health](https://phpackages.com/badges/laemmi-simple-template-engine/health.svg)](https://phpackages.com/packages/laemmi-simple-template-engine)
```

###  Alternatives

[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.5k34.7M186](/packages/phpoffice-phpword)[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)[leitsch/kirby-blade

Enable Laravel Blade Template Engine for Kirby 4 and Kirby 5

219.2k](/packages/leitsch-kirby-blade)

PHPackages © 2026

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