2017 © Pedro Peláez
 

library template

Templating library.

image

crazedsanity/template

Templating library.

  • Tuesday, August 15, 2017
  • by crazedsanity
  • Repository
  • 1 Watchers
  • 0 Stars
  • 422 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 27 Versions
  • 1 % Grown

The README.md

Template Build Status

Template system, based on cs_genericPage from cs-content (v1.x)., (*1)

This is a templating engine, built primarily to allow easy separation between PHP and HTML. Separating PHP from HTML helps keep the code clean and tends to avoid spaghetti code from happening., (*2)

Quick Definitions

Template: a file containing template vars., (*3)

Template Var: a string of text, following standard variable naming conventions, wrapped in curly braces: {templateVar}, (*4)

Sample

This is a simple example. Keep in mind that there's a lot of different ways to accomplish this same end result., (*5)

$recordSet = array(
            0 => array(
                'primary_id'    => 1,
                'record_name'   => 'The First Record',
                'another_field' => 'field value',
                'is_active'     => 0,
            ),
            1 => array(
                'primary_id'    => 3,
                'record_name'   => 'A third record',
                'another_field' => 'something else',
                'is_active'     => 1,
            ),
);
$tmpl = new Template(__DIR__ .'/path/to/file.tmpl');
$output = $tmpl->renderRows($recordSet);

The associated template file would look something like this:, (*6)

===============
{primary_id}|{record_name}|{another_field}|{is_active}|{invalid_field}
----

The output would look like this:, (*7)

===============
1|The First Record|field value|0|
----
===============
3|A third record|something else|1|
----

The Versions

15/08 2017

dev-master

9999999-dev http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

15/08 2017

v0.4.8

0.4.8.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

02/06 2017

v0.4.7

0.4.7.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

16/05 2017

v0.4.6

0.4.6.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

07/10 2016

v0.4.5

0.4.5.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

05/10 2016

v0.4.4

0.4.4.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

06/05 2016

v0.4.2

0.4.2.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

07/03 2016

v0.4.1

0.4.1.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

11/12 2015

v0.4.0

0.4.0.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

17/11 2015

v0.3.8

0.3.8.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

24/10 2015

v0.3.7

0.3.7.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

12/10 2015

v0.3.6

0.3.6.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

07/10 2015

v0.3.5

0.3.5.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

01/10 2015

v0.3.4

0.3.4.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

30/09 2015

v0.3.3

0.3.3.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

30/09 2015

v0.3.2

0.3.2.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

30/09 2015

v0.3.1

0.3.1.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

30/09 2015

v0.3.0

0.3.0.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

31/08 2015

v0.2.5

0.2.5.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

31/08 2015

v0.2.4

0.2.4.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

29/08 2015

v0.2.3

0.2.3.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

29/08 2015

dev-parsing_and_inheritance

dev-parsing_and_inheritance http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

22/08 2015

v0.2.2

0.2.2.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

10/08 2015

v0.2.1

0.2.1.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

12/05 2015

v0.2.0

0.2.0.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

11/02 2015

v0.1.1

0.1.1.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo

11/02 2015

v0.1.0

0.1.0.0 http://www.crazedsanity.com

Templating library.

  Sources   Download

MIT

The Requires

 

template php dry oaoo