PHPackages                             azettl/php-nano-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. azettl/php-nano-template

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

azettl/php-nano-template
========================

The php-nano-template class replaces placeholders in a string with values from an array.

0.0.5(5y ago)0261MITPHPPHP ^7.1

Since Aug 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/azettl/php-nano-template)[ Packagist](https://packagist.org/packages/azettl/php-nano-template)[ RSS](/packages/azettl-php-nano-template/feed)WikiDiscussions master Synced 2mo ago

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

php-nano-template - Template Engine
===================================

[](#php-nano-template---template-engine)

[![Codacy Badge](https://camo.githubusercontent.com/40b1d1d0cc457013e62a46247bd1b67b3d68e6f7e3eae75cca13c08d38b2546e/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3935303533343562306363613433303761393636333534313361663838373765)](https://www.codacy.com/app/azettl/nanoPHP?utm_source=github.com&utm_medium=referral&utm_content=azettl/nanoPHP&utm_campaign=badger)

The php-nano-template class replaces placeholders in a string with values from an array.

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

[](#installation)

```
composer require azettl/php-nano-template
```

Usage
-----

[](#usage)

```
$nano = new com\azettl\nano\template();
$nano->setTemplate(
  "
    {user.greeting()} {user.function(2)} {user.function('test')} {user.first_name} {user.last name}!
    Your account is {user.account.status}
    {user.nonexistingnode}
  "
);
$nano->setData($aData);
$nano->setShowEmpty(true);

echo $nano->render();
```

or

```
$nano = new com\azettl\nano\template(
  "
    {user.greeting()} {user.first_name} {user.last name}!
    Your account is {user.account.status}
    {user.nonexistingnode}
  ",
  [
    "user" => [
      "login" => "demo",
      "first_name" => "Anon",
      "last name" => "Ymous",
      "account" => [
        "status" => "active",
        "expires_at" => "2016-12-31"
      ],
      "greeting" => function(){
        return 'Hello';
      },
      "function" => function($param){
        return 'Test' . $param;
      }
    ]
  ]
);

echo $nano->render();
```

or

```
$nano = new com\azettl\nano\template();
$nano->setTemplateFile(
  "tests/template.html"
);
$nano->setData($aData);

echo $nano->render();
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% 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 ~260 days

Total

5

Last Release

2164d ago

### Community

Maintainers

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

---

Top Contributors

[![azettl](https://avatars.githubusercontent.com/u/644570?v=4)](https://github.com/azettl "azettl (34 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

---

Tags

templateengine

### Embed Badge

![Health badge](/badges/azettl-php-nano-template/health.svg)

```
[![Health](https://phpackages.com/badges/azettl-php-nano-template/health.svg)](https://phpackages.com/packages/azettl-php-nano-template)
```

###  Alternatives

[latte/latte

☕ Latte: the intuitive and fast template engine for those who want the most secure PHP sites. Introduces context-sensitive escaping.

1.3k15.7M680](/packages/latte-latte)[anourvalar/office

Generate documents from existing Excel &amp; Word templates | Export tables to Excel (Grids)

24085.2k](/packages/anourvalar-office)[templavoilaplus/templavoilaplus

Building kit for custom pages and content elements with individual fields, containers and backend layouts. Supporting drag'n'drop and multiple references.

2637.6k13](/packages/templavoilaplus-templavoilaplus)

PHPackages © 2026

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