PHPackages                             vovan-ve/html-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. vovan-ve/html-template

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

vovan-ve/html-template
======================

Context sensitive HTML template engine

v0.3.4(7y ago)019MITPHPPHP ^7.1

Since Sep 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Vovan-VE/html-template)[ Packagist](https://packagist.org/packages/vovan-ve/html-template)[ RSS](/packages/vovan-ve-html-template/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (19)Used By (0)

HTML Template
=============

[](#html-template)

[![Latest Stable Version](https://camo.githubusercontent.com/68bfe619cce562e4c959f4a3d452407a6103748f3663cac3318ea25ba0450a2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766f76616e2d76652f68746d6c2d74656d706c6174652e737667)](https://packagist.org/packages/vovan-ve/html-template)[![Latest Dev Version](https://camo.githubusercontent.com/a87ba367f9c51048622e3889fbc7f59bcda81ee0edb9c5cd1a7ab52dd51c2ab1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f766f76616e2d76652f68746d6c2d74656d706c6174652e737667)](https://packagist.org/packages/vovan-ve/html-template)[![Build Status](https://camo.githubusercontent.com/63d2e10f946d7bc66ecbeccdb4c1deafb86149f0891a848b6ccd1df52b98e599/68747470733a2f2f7472617669732d63692e6f72672f566f76616e2d56452f68746d6c2d74656d706c6174652e737667)](https://travis-ci.org/Vovan-VE/html-template)[![License](https://camo.githubusercontent.com/aca7ff11c6f843ce85728c16815b96cad3f74e3ef0a2a1602b32fea10ae8de70/68747470733a2f2f706f7365722e707567782e6f72672f766f76616e2d76652f68746d6c2d74656d706c6174652f6c6963656e7365)](https://packagist.org/packages/vovan-ve/html-template)

Simple context sensitive HTML template engine. Yes, yet another one.

Synopsis
--------

[](#synopsis)

See [an examples](./examples/).

Template example:

```

        { description }

        {# comment #}

```

Creating data for the template above:

```
use VovanVE\HtmlTemplate\runtime\RuntimeHelper;

$runtime = new RuntimeHelper([
    'link' => 'http://example.com?foo=bar&lorem=ipsum#hash',
    'title' => 'Lorem  "dolor" sit amet',
    'description' => function () {
        return 'Some  content';
    },
]);
```

Run a template when everything is prepared. Here `foobar` is a template's name covered by Template Provider.

```
echo $engine->runTemplate('foobar', $runtime);
```

The output for the example above (wrapped manually only here):

```
Some &lt;text/plain&gt; content
```

Template code compiles to PHP code behind the scene. It may look something like so (formatted manually only here for demonstration):

```
($runtime::createElement('a', [
    'href'  => ($runtime->param('link')),
    'title' => (!($_ta=($runtime->param('title')))
        ? $_ta
        :(('Foo bar: '.($runtime->param('title'))))
    )
], [
    ($runtime::createElement('span', [
        'id'    => 'foobar',
        'class' => 'it parses html'
    ], [
        ($runtime::htmlEncode(($runtime->param('description'))))
    ])),
    ''
]))
```

Compiler will evaluate as much constant expressions as possible and as much as it learned to. For example, completely constant template like following:

```
{true && 'Lorem < ipsum dolor'}

```

will be compiled to:

```
'Lorem &lt; ipsum dolor'
```

Description
-----------

[](#description)

TBW.

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

[](#installation)

> **ATTENTION!** While major version number is `0` still there MAY be BC break changes in minor versions `0.NEXT`, but not in revision versions `0.x.NEXT`.

Install through [composer](http://getcomposer.org/):

```
composer require vovan-ve/html-template

```

or add to `require` section in your composer.json:

```
"vovan-ve/html-template": "~0.3.0"

```

License
-------

[](#license)

This package is under [MIT License](https://opensource.org/licenses/MIT)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Recently: every ~15 days

Total

18

Last Release

2720d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1166581?v=4)[Vladimir](/maintainers/Vovan-VE)[@Vovan-VE](https://github.com/Vovan-VE)

---

Top Contributors

[![Vovan-VE](https://avatars.githubusercontent.com/u/1166581?v=4)](https://github.com/Vovan-VE "Vovan-VE (99 commits)")

---

Tags

html-templateserver-side-renderingtemplate-engine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vovan-ve-html-template/health.svg)

```
[![Health](https://phpackages.com/badges/vovan-ve-html-template/health.svg)](https://phpackages.com/packages/vovan-ve-html-template)
```

###  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)
