PHPackages                             jinnguyen/puja - 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. jinnguyen/puja

ActiveLibrary

jinnguyen/puja
==============

Puja is a lightweight, flexible and easy PHP template engine. Inspired in django, Puja also support validate template syntax!

v1.1.0(9y ago)59541The MIT License (MIT)PHP

Since Oct 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jinnguyen/puja)[ Packagist](https://packagist.org/packages/jinnguyen/puja)[ RSS](/packages/jinnguyen-puja/feed)WikiDiscussions master Synced 1mo ago

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

Puja v1.1
=========

[](#puja-v11)

Puja is a lightweight, flexible and easy PHP template engine. Inspired in django, Puja also support validate template syntax!

**Install:**

- **Composer**

```
composer require jinnguyen/puja
require 'vendor/autoload.php';
$puja = new Puja();
```

- **Old style**

```
require '/path/to/Autoload.php';
$puja = new Puja();
```

**Some of Puja's features**:

- **VALIDATE TEMPLATE SYNTAX**
- it is extremely fast
- no template parsing overhead, only compiles once.
- it is smart about recompiling only the template files that have changed.
- unlimited nesting of sections, conditionals, etc.
- built-in caching of template output.

**Validate syntax:**
Puja support validate syntax before the parser run compiler. This will helpfull for you to write template syntax.

**Download**
GIT: *git clone *
SVN: *svn checkout *
Source code: **

Bug list: [https://github.com/jinnguyen/puja/issues?page=1&amp;state=open](https://github.com/jinnguyen/puja/issues?page=1&state=open)

Example: file template: index.tpl:

```
{% extends master.tpl %}
{% block body %}
	Hello, {{ a }
	Welcome you go to Puja template examples
{% endblock %}
```

The result will be:

```

```

Puja only show debug when mode **debug** is enabled
\*\* We recommend you should only enable mode **debug** when your app is in develop. And disable it when your app go to production. It will save a lot time to template engine parser.

**Basic API Usage**:

- template file: index.tpl

```
Hello {{ username }},
Welcome you go to the very first exmplate of Puja template.
```

- php file: index.php

```

```

The result will show:

```
Hello Jin Nguyen,
Welcome you go to the very first exmplate of Puja template.
```

See [User's guide](https://github.com/jinnguyen/puja/tree/master/docs/user-guide.md) for full information.

**Template Inheritance**:

- master.tpl:

```
==== Start Master ===
{% block body %}Master Body{% endblock body %}
{% block javascript %}Master javascript{% endblock javascript %}
==== End Master ====
```

- index.tpl

```
{% block javascript %}Index javascript{% endblock javascript %}
{% block body %}Index Body{% endblock body %}
```

And the result will be:

```
==== Start Master ===
Index Body
Index javascript
==== End Master ====
```

[more detail &gt;&gt; ](https://github.com/jinnguyen/puja/tree/master/docs)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 94% 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

3485d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25e5bd31b5dd70d47cbdc738bded06dbabfba3d584acce63c2c4b4fb7847f39d?d=identicon)[jinnguyen](/maintainers/jinnguyen)

---

Top Contributors

[![linhnnmt](https://avatars.githubusercontent.com/u/162856460?v=4)](https://github.com/linhnnmt "linhnnmt (109 commits)")[![linhnmt](https://avatars.githubusercontent.com/u/10231628?v=4)](https://github.com/linhnmt "linhnmt (7 commits)")

---

Tags

template enginephp template enginepujadjango styletemplate engine validate syntax

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jinnguyen-puja/health.svg)

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

###  Alternatives

[phptal/phptal

PHPTAL is a templating engine for PHP5 that implements Zope Page Templates syntax

179421.6k19](/packages/phptal-phptal)[foil/foil

PHP template engine for native PHP templates

170111.2k7](/packages/foil-foil)[proai/laravel-handlebars

A Laravel wrapper for LightnCandy for using the Handlebars (and Mustache) template engine.

38204.7k](/packages/proai-laravel-handlebars)[talesoft/tale-pug

A clean, lightweight and easy-to-use templating engine for PHP based on Pug, formerly Jade

319.4k3](/packages/talesoft-tale-pug)[wanze/template-engine-factory

Provides ProcessWire integration for various template engines such as Twig.

2612.0k4](/packages/wanze-template-engine-factory)[leitsch/kirby-blade

Enable Laravel Blade Template Engine for Kirby 4 and Kirby 5

219.2k](/packages/leitsch-kirby-blade)

PHPackages © 2026

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