PHPackages                             andrewpk/aktemplate - 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. andrewpk/aktemplate

ActiveLibrary

andrewpk/aktemplate
===================

A super simple php templating library for learning. So simple, you probably can just look at how this code works and do it yourself.

1.0.0(2y ago)05MITPHPPHP &gt;=8.0

Since May 27Pushed 2y ago1 watchersCompare

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

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

AKTemplate
==========

[](#aktemplate)

A simple html view templating engine for PHP with zero dependencies. This all started quite a few years ago as a gist, as I used similar styles of templating based off my work with smarty and jinja templates in the past.

I realized how my gist was quite outdated and had no documentation, so I decided to publish this as an actual library.

Usage
-----

[](#usage)

`composer require andrewpk/aktemplate`

And then you can either import the class:

```
use AKTemplate\Template;
```

Or you can just reference the fully qualified namespace when creating a template:

```
$template = new AKTemplate\Template();
```

Inside your templates you can set and get variables using the `$t` shortcut:

```

```

If you name your templates with the `.tpl` suffix, most editors won't complain about the undefined `$t` variable. If you'd prefer, you can name your templates with a .php suffix and then an annotation in a php block at the top instead:

```

```

Example
-------

[](#example)

Check out the `Example` directory for a working example.

License
-------

[](#license)

MIT

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

1084d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ec624ec0f9864d0339e487b7dc7703c8cb9db5e423e359353fff28d45c5b662?d=identicon)[Andrewpk](/maintainers/Andrewpk)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/andrewpk-aktemplate/health.svg)

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

PHPackages © 2026

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