PHPackages                             danack/jig - 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. danack/jig

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

danack/jig
==========

Lightweight, fast, flexible PHP templating system that uses real dependency injection.

0.21.2(10y ago)68102[13 issues](https://github.com/Danack/Jig/issues)3MITPHP

Since Jul 23Pushed 10y ago2 watchersCompare

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

READMEChangelogDependencies (7)Versions (51)Used By (3)

Jig - Lightweight, fast, testable PHP templating system.
========================================================

[](#jig---lightweight-fast-testable-php-templating-system)

Jig - "A device that holds a piece of machine work and guides the tools operating on it."

Or to put it another way, a jig allows you to work fast with sharp tools without cutting your fingers off.

   Build status      [ ![Latest Stable Version](https://camo.githubusercontent.com/647305d5c9c9f8e8a0bfbdd75f81b5c9907b1bdfd1a665e475a3e8964f4b22ff/68747470733a2f2f7472617669732d63692e6f72672f44616e61636b2f4a69672e706e67) ]()   What
----

[](#what)

Jig is a template renderer that promotes the view layer to be a first class citizen in your application.

By using it, all of your templates are unit-testable as it does not use the 'service locator' pattern like most other templating systems do.

- Compiles to PHP class for super-duper performance.
- Uses real Dependency injection in templates, to allow unit testing of views.
- Super lightweight. Zero overhead when templates are already compiled when used with APC/OPCache
- Simple but powerful plugin system.

Documentation
-------------

[](#documentation)

Please run this to view the documentation:

```
git clone https://github.com/danack/TierJigDocs
cd TierJigDocs/
composer install
mkdir -p var/cache
php -S localhost:8000 -t public

```

The "I know what I'm doing" just show me some code" guide to using Jig
----------------------------------------------------------------------

[](#the-i-know-what-im-doing-just-show-me-some-code-guide-to-using-jig)

```
use Auryn\Injector;
use Jig\JigConfig;
use Jig\Jig;

// Create a JigConfig object
$jigConfig = new JigConfig(
    //The directory the source templates are in
    __DIR__."/../templates/",
    //The directory the generated PHP code will be written to.
    __DIR__."/../var/generatedTemplates/",
    // How to check if the templates need compiling.
    Jig::COMPILE_CHECK_MTIME,
    // The extension our templates will have.
    "php.tpl"
);

// Create a Jig renderer with our config
$jig = new Jig($jigConfig);

// Check the template is compiled to PHP and get the classname of the
// generated PHP template.
$className = $jig->compile("gettingStarted/basic");

// Create a DIC that can create an instance of the template
$injector = new Injector();

$injector->alias('Jig\Escaper', 'Jig\Bridge\ZendEscaperBridge');

// Create an instance of the template
$templateInstance = $injector->make($className);

// Render the template and send it to the user.
$output = $templateInstance->render();

// Send the output to the user
echo $output;

// Alternatively if your DIC supports direct execution
//$output = $injector->execute([$className, 'render']);

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Recently: every ~4 days

Total

49

Last Release

3753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9db967c6005625e444a502fb830a30669b9fed53bfbc67e81a054508c0975a6b?d=identicon)[Danack](/maintainers/Danack)

---

Top Contributors

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

---

Tags

librarytemplateviewjig

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/danack-jig/health.svg)

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

###  Alternatives

[leitsch/kirby-blade

Enable Laravel Blade Template Engine for Kirby 4 and Kirby 5

219.2k](/packages/leitsch-kirby-blade)[johnturingan/laravel-fly-view

Render Blade templates from string mark-up.

163.9k](/packages/johnturingan-laravel-fly-view)

PHPackages © 2026

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