PHPackages                             alexkuusk/malli - 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. alexkuusk/malli

ActiveLibrary

alexkuusk/malli
===============

Slim PHP template parser

v0.1(2y ago)014PHPPHP &gt;=8.2

Since Feb 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alexkuusk/malli)[ Packagist](https://packagist.org/packages/alexkuusk/malli)[ RSS](/packages/alexkuusk-malli/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Light Template Engine
=====================

[](#light-template-engine)

A simple and lightweight PHP templating engine using few custom tags that all are translated into pure PHP. PHP is also allowed inside templates, just be aware of the scopes. Template blocks are compiled into PHP functions and functions are called and their output captured.

Possibility to add custom tags, for example translation code. That code's output can be turned into static and saved along with PHP code, so that heavy translating functions are not called every page load. Supports multilanguage and multisite, just pass language parameter and use dynamic path with another set of templates ('path' =&gt; '../tpl/' . $\_SERVER\['SERVER\_NAME'\] . '/').

Blocks can be nested inside blocks.

Requires PHP version 8.2+

Setup
-----

[](#setup)

See Example folder for more complex examples

```
composer install alexkuusk/malli

```

minimal

```
require_once '../vendor/autoload.php';

use Alexkuusk\Malli\Malli;

echo (new Malli([
    '_params' => [
        'path' => '../tpl/',
        'file' => 'index.tpl',
        'block' => 'index', //if omitted, file name without extension is used
    ],
    '_data' => [
        'title' => 'Template test',
        'books' => [
            'One',
            'two',
        ]
    ]));
```

index.tpl

```
{{ BLOCK:index }}

    {{ $title }}

{{ FOREACH $books as $k => $title }}

        {{ $k + 1 }}
        {{ htmlspecialchars($title) }}

{{ /FOREACH }}

{{ /BLOCK:index }}
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/790d61979c7439bc73f0fad4e2b896dcd6d0028b4acca3d3401be66dcc89bc6a?d=identicon)[alexkuusk](/maintainers/alexkuusk)

---

Top Contributors

[![alexkuusk](https://avatars.githubusercontent.com/u/54668221?v=4)](https://github.com/alexkuusk "alexkuusk (2 commits)")

### Embed Badge

![Health badge](/badges/alexkuusk-malli/health.svg)

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

PHPackages © 2026

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