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

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

futape/simple-template
======================

A damn simple template engine

1.0.0(6y ago)02MITPHPPHP ~7.2.0CI failing

Since Nov 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/futape/simple-template)[ Packagist](https://packagist.org/packages/futape/simple-template)[ RSS](/packages/futape-simple-template/feed)WikiDiscussions master Synced 3w ago

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

futape/simple-template
======================

[](#futapesimple-template)

This library offers a very simple template engine.

The engine's only function is to resolve placeholders in the template to defined variable values or PHP constants.

Install
-------

[](#install)

```
composer require futape/simple-template
```

Usage
-----

[](#usage)

```
use Futape\SimpleTemplate\Template;

$template = (new Template(
    "Hello {{\$name}},\n\nthis is an usage example of futape/simple-template.\nYour installed PHP version is " .
        "{{PHP_VERSION}}."
))
    ->addVariable('name', 'Stranger');

echo $template->render();
/* Hello Stranger,

this is an usage example of futape/simple-template.
Your installed PHP version is 7.2.0. */
```

Placeholders may be escaped using a `\` in front of the second `{`.
`{\{$foo}}` would result in `{{$foo}}` (or `{\{$foo}}` if the `unescapePlaceholders` config is disabled).

The engine can be configured, either via a constructor's second argument or by calling `setConfig()`.
The following configuration options exist:

NameTypeDefaultDescriptionunescapePlaceholdersbooltrueIf `\` characters used to escape placeholders should be removed from the rendered templateresolveConstantsbooltrueIf resolving placeholders to constants is enableddiscardUndefinedVariablesbooltrueIf unresolvable placeholders should be removed from the rendered templateTesting
-------

[](#testing)

The library is tested by unit tests using PHP Unit.

To execute the tests, install the composer dependencies (including the dev-dependencies), switch into the `tests`directory and run the following command:

```
../vendor/bin/phpunit
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

2412d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4106712?v=4)[Lucas Krause](/maintainers/futape)[@futape](https://github.com/futape)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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