2017 © Pedro Peláez
 

library jig

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

image

danack/jig

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

  • Sunday, February 7, 2016
  • by Danack
  • Repository
  • 2 Watchers
  • 6 Stars
  • 703 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 2 Forks
  • 13 Open issues
  • 51 Versions
  • 1 % Grown

The README.md

Jig - Lightweight, fast, testable PHP templating system.

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

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

Build status
Latest Stable Version

What

Jig is a template renderer that promotes the view layer to be a first class citizen in your application., (*3)

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., (*4)

  • Compiles to PHP class for super-duper performance., (*5)

  • Uses real Dependency injection in templates, to allow unit testing of views., (*6)

  • Super lightweight. Zero overhead when templates are already compiled when used with APC/OPCache, (*7)

  • Simple but powerful plugin system., (*8)

Documentation

Please run this to view the documentation:, (*9)

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

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']);

The Versions

07/02 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

07/02 2016

0.21.2

0.21.2.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

06/02 2016

dev-blockRenderExtraLine

dev-blockRenderExtraLine

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

06/02 2016

0.21.1

0.21.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

26/01 2016

0.21.0

0.21.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

20/01 2016

0.20.6

0.20.6.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

20/01 2016

0.20.5

0.20.5.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

28/12 2015

0.20.4

0.20.4.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

26/12 2015

0.20.3

0.20.3.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

26/12 2015

0.20.2

0.20.2.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

23/12 2015

0.20.1

0.20.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

20/12 2015

0.20.0

0.20.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

20/12 2015

0.19.0

0.19.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

18/12 2015

0.18.1

0.18.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

18/12 2015

0.18.0

0.18.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

14/12 2015

0.17.2

0.17.2.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

31/10 2015

0.17.1

0.17.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

29/10 2015

0.17.0

0.17.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

23/08 2015

0.16.4

0.16.4.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

22/08 2015

0.16.2

0.16.2.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

22/08 2015

0.16.3

0.16.3.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

18/08 2015

0.16.1

0.16.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

18/08 2015

0.16.0

0.16.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

05/08 2015

0.15.1

0.15.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

05/08 2015

0.15.0

0.15.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

22/07 2015

0.14.5

0.14.5.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

22/07 2015

0.14.4

0.14.4.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

21/07 2015

0.14.3

0.14.3.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

21/07 2015

0.14.2

0.14.2.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

11/07 2015

0.14.1

0.14.1.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

06/07 2015

0.14.0

0.14.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

03/07 2015

0.13.0

0.13.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

template library view jig

18/05 2015

0.12.0

0.12.0.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

14/03 2015

0.11.0

0.11.0.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

05/03 2015

0.10.2

0.10.2.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

26/02 2015

0.10.1

0.10.1.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

01/09 2014

0.9.2

0.9.2.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

30/06 2014

0.10.0

0.10.0.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

02/05 2014

0.9.1

0.9.1.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

16/02 2014

0.9.0

0.9.0.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

07/11 2013

0.2.1

0.2.1.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

06/11 2013

0.2.0

0.2.0.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

MIT

The Requires

 

The Development Requires

library core intahwebz

10/09 2013

0.1.8

0.1.8.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz

26/08 2013

0.1.7

0.1.7.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz

26/08 2013

0.1.6

0.1.6.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz

20/08 2013

0.1.5

0.1.5.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz

11/08 2013

0.1.4

0.1.4.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz

08/08 2013

0.1.3

0.1.3.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz

07/08 2013

0.1.2

0.1.2.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz

07/08 2013

0.1.1

0.1.1.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz

23/07 2013

0.1.0

0.1.0.0

Lightweight, fast, flexible PHP templating system. Just like all the others.

  Sources   Download

The Requires

 

The Development Requires

library core intahwebz